How can I make sure that only one KeyBinding command is executed when using a keyboard shortcut?

I have the following KeyBindings:

<KeyBinding Gesture="Ctrl+S" Command="Save" /> <KeyBinding Gesture="Ctrl+Shift+S" Command="SaveAs" /> 

When I press Ctrl + Shift + S to execute the SaveAs , it works, but immediately after that the Save command is also executed. Is this related to my Gesture definitions?

+6
source share
1 answer

You must mark RoutedEvent as Handled=true with the RoutedEventArgs parameter in your method that handles the save.

+3
source

Source: https://habr.com/ru/post/912867/


All Articles