Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Keyboard Modifier on MouseBinding

I'm working with the MVVM pattern in WPF (a bit new to both).

I'd like to set up an InputBinding on a CheckBox that corresponds to a Control + Click event, but do not see a Modifiers property on the MouseBinding element. This is what I'd like to achieve (fictitious code, obviously- Modifiers doesn't exist):

<CheckBox>
     <CheckBox.InputBindings>
           <MouseBinding MouseAction="LeftClick" 
                         Command="{Binding CheckboxControlClickCommand}"
                         Modifiers="Control" />
     </CheckBox.InputBindings>
</CheckBox>

Any ideas on how to accomplish this without using events?

Thanks!

like image 681
egoodberry Avatar asked Dec 02 '22 07:12

egoodberry


1 Answers

Use it with keybinding too!

like image 55
Natxo Avatar answered Dec 21 '22 02:12

Natxo