How can I ensure that only one KeyBinding command is executed when a keyboard shortcut is used?

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 command, it works -- but directly afterwards, the Save command is also executed. Is this caused by my Gesture definitions?

Answers


You have to mark the RoutedEvent as Handled=true using the RoutedEventArgs parameter in your method that handles the save.


Need Your Help

How can I identify references to Java classes using Perl?

java perl parsing

I'm writing a Perl script and I've come to a point where I need to parse a Java source file line by line checking for references to a fully qualified Java class name. I know the class I'm looking f...

I need to validate about 12 textboxes on my JAVA swing UI (NetBeans)

java swing validation netbeans

ok, so as the title tells you, that i need to validate the 12 textboxes on ONE tab. i was thinking to do it by opening every text box individually and add the validation code. But the problem is th...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.