R – Fire a template child event in current context

datatemplateevent handlingeventsetterwpf

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 handler should be declared on the Page that contains the ControlControl which uses this DataTemplate.

Any ideas?

Best Answer

Related Topic