如何更改内置/现有应用程序命令快捷方式

时间:2014-07-01 13:01:05

标签: wpf xaml

如何更改内置'复制命令快捷方式,例如' CTRL + Q'要么 添加到现有的EditingCommands.IncreaseFontSize快捷方式?

我知道如何从头开始制作命令,但如何编辑它以用于现有命令?

1 个答案:

答案 0 :(得分:3)

您可以向命令的InputGetures集合

添加新的KeyGesture
EditingCommands.IncreaseFontSize.InputGestures.Add(new KeyGesture(Key.Q, ModifierKeys.Control));

并修改现有的命令手势,您可以从清单列表中删除

ApplicationCommands.Copy.InputGestures.Clear();
ApplicationCommands.Copy.InputGestures.Add(new KeyGesture(Key.Q, ModifierKeys.Control));