I have a ListBox that uses DataTemplateSelector to dynamically decide what template to use based on the type of the item in the list. I now want to hook the events that could be fired by controls within the DataTemplate. For example, if one of the templates has a checkbox in it, I want the application using the control to be notified when the checkbox is checked. If a different template has a button within it, I want to be notified when the button is clicked.
Also, since its a ListBox, many of the items could have the same template. So I will need some kind of RoutedEventArgs so I can walk up from OriginalSource to get some context information to handle the event.
My solution was to use MouseLeftButtonUp. This works fine for TextBlocks, but it looks like CheckBox and Button controls set handled to true, so the event doesnt bubble up. How can I address these events so I can assign handlers to them in my calling application?
(Also, Silverlight doesn't actually support DataTemplateSelector, so i followed this example to implement it)