本文仅为博主备忘用
相关引用
using System.Windows.Input;
绑定命令
public List<keybinding> InputKeyBindings = new List<keybinding>();
public ICommand AddCommand;
InputKeyBindings.Add(new KeyBinding { Modifiers = ModifierKeys.Alt, Key = Key.A, Command = AddCommand });
将按键绑定添加到用户控件中
userControl.InputBindings.AddRange(InputKeyBindings);