I want to set two shortkeys for two buttons with one shortkey name.
How can i detect which control is focused in MVVM ?
I want to set two shortkeys for two buttons with one shortkey name. How
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can simply add the hotkey to whatever scope is logical for it to exist in. There are many ways to handle hotkeys to WPF, however your basic markup should look something like this:
This will run
SaveACommandifUserControlAhas keyboard focus, orSaveBCommandifUserControlBhas keyboard focus.