我有一个主窗口,其中有一些键绑定,如下所示:
<Window.InputBindings>
<KeyBinding Command="{Binding RotateCommand}"
CommandParameter="left"
Key="L">
</KeyBinding>
<KeyBinding Command="{Binding RotateCommand}"
CommandParameter="right"
Key="R" />
</Window.InputBindings>
问题是我无法在该窗口的任何文本框中键入这些字母,L 和 R 键只是调用命令。
有没有办法禁用某些控件内部的 KeyBindings? (也许当某些控件具有焦点时)。
我通过互联网搜索并找到this https://social.msdn.microsoft.com/Forums/vstudio/en-US/d0f08499-2518-40b3-a5fc-17ded19377fd/keybinding-and-textbox?forum=wpf,但我无法访问 CanExecute 路由事件,因为我正在使用mvvm
命令绑定的模型。
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)