Now, back to reading this blog post for more details :).
--
Quidquid latine dictum sit, altum sonatur.
- Whatever is said in Latin sounds profound.
War is peace. Freedom is slavery. Bugs are features.
Thanks to Mr. Gossman's lazy initialization for read-only attached
properties, I could finally get around to mostly burying this concept
with an "almost optimal" design, if I had the time to work on this
again. However, I don't have the time right now, and I'm still hoping
Microsoft addresses the real issue in all of this: I can't specify an
event handler from any object but "this" (meaning it must be in the
code behind). If I could just do this:
<Button Click="{EventHandler Source={StaticResource ViewModel},
Handler=ClickHandler}">Click me!</Button>
Where Source would default to the DataContext if not supplied, so
MVPoo scenarios could be simplified to:
<Button Click="{EventHandler ClickHandler}">Click me!</Button>
Then allow me to do the same with a CommandBinding. Or some other
syntax. What ever. Just let me specify event handlers outside of the
code behind! :)
BTW, I've not looked at the code yet, but the article is top notch! Way to go.