Reputation: 1461
I have a WPF application written in C#. This application has dialog windows in it. Each of these dialogs have a "Save" and "Cancel" button. When a user presses "Enter" on the keyboard, I want to automatically "press" the "Save" button. When a user presses "Esc" on their keyboard, I want to simulated clicking the "Cancel" button. Is there a clean way to do this in WPF?
Thank you!
Upvotes: 7
Views: 6012