开发者

Fire a template child event in current context?

开发者 https://www.devze.com 2022-12-18 18:53 出处:网络
Is there a way to fire an event from a visual within a DataTemplate in the current context (i.e. Page, Window, UserControl etc.).

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消