Try the Marlon Grech attached behavior commands , as mentioned in this previous question.
Alternatively, as a simpler but less flexible solution, execute the implementation Handlerin code to raise the command directly, for example:
<EventSetter Event="PreviewMouseDoubleClick" Handler="MyPreviewDoubleClickHandler"/>
// In the code-behind
private void MyPreviewDoubleClickHandler(object sender, RoutedEventArgs args) {
object my_param = ...;
MyCommand.Execute(my_param, this);
}
Keith source
share