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}"/>
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}"/>
Copyright © 2021 Jogjafile Inc.
Try Marlon's Grech's attached commands behaviours, as mentioned in this previous question.
Alternatively, as a simpler but less flexible solution, provide a
Handler
implementation in the code-behind to raise the command directly, like this: