当然,都要统一到 CommandBinding 上了。
使用 KeyBinding 就可以了。如果想要在菜单后面显示快捷方式,就使用 InputGestureText
代码如下:
<Window.CommandBindings>
<CommandBinding Command&#61;"zp:ZippyCommands.NodeDown" CanExecute&#61;"ZippyCommands_CanExecute" Executed&#61;"ZippyCommands_Executed" />
Window.CommandBindings>
<Window.InputBindings>
<KeyBinding Command&#61;"zp:ZippyCommands.NodeDown" Key&#61;"Z" Modifiers&#61;"Shift">KeyBinding>
Window.InputBindings>
<MenuItem Header&#61;"下移" Name&#61;"cmNodeDown" Command&#61;"zp:ZippyCommands.NodeDown" InputGestureText &#61; "Shift&#43;Z" />