Hello.
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 decl...
I have styled a window to replace the standard Chrome and I want to handle the Activated and Deactivated events using EventSetters. I get an error "...'Activated' must be a RoutedEvent registered..." with this:
<EventSetter Event="Activated" Handler="Window_Activated"/>
However, this works fine in the same style.
<EventSetter Ev...
I have a ItemsControl with a collection of objects. I wan't to be able to click the object and then get a panels with more info.
So I decided to style the DataTemplate for the items in the ItemsControl as a button and that seems to work fine. However I have no idea how to set the click event of this button in the style. It says I should...
Hello,
How to assign a command to the Handler in EventSetter, I want to to write this:
<Style x:Key="ItemStyle" TargetType="{x:Type ListBoxItem}">
<EventSetter Event="PreviewMouseDoubleClick" Handler="{Binding MyDoubleClickCommand}"/>
...