Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KeyBinding for gestures CTRL+C and CTRL+ V do not work?

I have a few ICommands in my View Model which I would like to bind them using Key Board bindings to my user control. The problem I am facing is that they are not fired when I use CTRL + C and CTRL + V to bind my copy and paste commands in my UserControl. Am I supposed to override them or something?.

<UserControl.InputBindings>
    <KeyBinding Gesture="CTRL+C" Command="{Binding CopyCommand}" />
</UserControl.InputBindings>
like image 347
Ammark Avatar asked Sep 12 '26 21:09

Ammark


1 Answers

This works for me like a charm:

<!--COPY-->
<UserControl.InputBindings>
    <KeyBinding Key="C" Modifiers="Ctrl" Command="{Binding CopyToStackCommand}" />
</UserControl.InputBindings>

<!--PASTE-->
<UserControl.InputBindings>
    <KeyBinding Key="V" Modifiers="Ctrl" Command="{Binding PasteFromStackCommand}" />
</UserControl.InputBindings>

like image 200
A. Dzebo Avatar answered Sep 15 '26 09:09

A. Dzebo