Fire a template child event in current context?
Is there a way to fire an event from a visual within a DataTemplate in the current context (i.e. Page, Window, UserControl etc.).
For example I have a DataTemplate that contains a button or a ListBox. I want that when the button is clicked or when ListBox.SelectionChanged is fired in the ListBox, the event han开发者_如何学Pythondler should be declared on the Page that contains the ControlControl which uses this DataTemplate.
Any ideas?
Use RoutedCommands.
精彩评论