Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
875
Does anyone know how to make Keyboard shortcuts actually work?
posted

OK, here's a sample project.  Someone please answer:

If you right click inside the Save button and click Save on the context menu it works.  How to get the shortcut (Ctrl+S) to do the same????????????????????????

example.zip
  • 138253
    Offline posted

    Hello,

     

    I am just checking if you got this worked out or you still require any assistance or clarification on the matter.

  • 138253
    Suggested Answer
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and the sample project you have provided and I modified it, so now it works as you want. Basically I create an instance of your CommandRefference class and bound its Command Property to the save command because the KeyBinding’s Command Property isn’t a Dependency Property and cannot be bound. Also here you can read more about MVVM Commands:

     

    http://joyfulwpf.blogspot.com/2009/05/mvvm-commandreference-and-keybinding.html

     

    Please let me know if this helps you or you need further clarification s on this matter.

     

    Looking forward for your reply.

    SAMPLE.MVVM.zip