Windows Presentation Foundation SDK : ItemControls don’t properly select items or raise events when bound to a data source

|

When doing my daily RSS catch-up (I'm loving Google Reader at the moment), I came across this:

Windows Presentation Foundation SDK : ItemControls don’t properly select items or raise events when bound to a data source

It's only a short article but it points out something very important when working with data templates in WPF: it's a template. I know that sounds obvious, but it's easy to forget.

Setting events, by using EventSetter, is not as natural as setting them directly in the template XAML with Click="blah" but attaching events to the cookie cutter and not the cookie will give unexpected results, so don't get burned (I know my analogy sucks, feel free to comment something better).

1 comment:

Anonymous said...

Finally, an issue that I am passionate about. I have looked for information of this caliber for the last several hours. Your site is greatly appreciated.