I am trying to set the double click gesture of a text box in this way:
<TextBox>
<TextBox.InputBindings>
<MouseBinding Gesture="MouseDoubleClick" Command="{Binding DobleClickCommand}"/>
</TextBox.InputBindings>
</Textbox>
But I get the error that the mouse action MOUSEDOUBLECLICK is not allowed.
I would like to bind it to the command in my view model.
Is input bindings the way to do it?
Your mouse binding is wrong, there is no
MouseDoubleClick, useLeftDoubleClick. For a list of valid mouse actions, look in the documentation. If you want to execute the action forMiddleDoubleClickorRightDoubleClick, too, you can create separate mouse bindings for them to the same command.Alternatively, you can use
MouseActioninstead of aGesture:The documentation recommends to use
Gestureinstead ofMouseAction:On the difference between a
MouseActionand aGesture: