Search code examples
wpfmvvmdependency-propertiesinputbinding

If we can't bind a MouseBinding's Command, what are we supposed to do?


I would love to be able to use a regular MouseBinding to capture a CTRL-Click event on my TextBlock. Unfortunately the Command property is not a dependency property and I'm using MVVM, so I can't bind it to my viewmodel.

How could Microsoft have left out this basic functionality? Are there no easy ways to detect CTRL-Clicks and bind them to a command in my viewmodel?


Solution

  • You could always take a look at using Attached Command Behaviours.