Application Level shortcut keys in WPF

前端 未结 2 1017
温柔的废话
温柔的废话 2020-12-11 03:16

In WPF application I am currently trying to bind a Command to launch a calculator Tool form any where in the application using shortcut keys, I have created a command but no

2条回答
  •  眼角桃花
    2020-12-11 03:27

    You can do this in xaml - see the example in the documentation for the KeyBinding class:

    
      
    
    

    Update: Looks like you can't actually bind a KeyBinding to a ViewModel using just xaml if you're using MVVM: see here Keybinding a RelayCommand.

提交回复
热议问题