I need to bind the double click event of a textblock (or potentially an image as well - either way, its a user control), to a command in my ViewModel.
TextBlock.InputBindings does not seem to bind correctly to my commands, any help?
The command is the action to be executed. The command source is the object which invokes the command. The command target is the object that the command is being executed on. The command binding is the object which maps the command logic to the command.
<Button> <Button.InputBindings> <MouseBinding Gesture="LeftDoubleClick" Command="YourCommand" /> </Button.InputBindings> </Button>
http://thejoyofcode.com/Invoking_a_Command_on_a_Double_Click_or_other_Mouse_Gesture.aspx
Try Marlon Grech's attached command behaviors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With