在WPF应用程序级别的快捷键快捷键、应用程序、级别、WPF

2023-09-02 01:50:48 作者:委屈都往肚子里咽

在WPF应用程序,目前我正在试图绑定命令来启动使用快捷键计算器工具形成应用任何地方,我创建了一个命令,但没有得到如何映射命令和快捷键创建通用的快捷键我的申请。 先谢谢了。

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 not getting how to map commands and shortcut keys to create universal shortcut keys in my application. Thanks in advance.

推荐答案

命令管理要采用集中控制为出发点进行路由所有输入绑定。

The CommandManager wants to use the focused control as the starting point for routing all input bindings.

我已经写了一个行为可以让你轻松全局快捷键绑定使用的RoutedCommand(标准WPF)和的ICommand(MVVM式的)任何控制。

I've written a Behavior that allows you to easily bind global shortcut keys for any control using RoutedCommand (standard WPF) and ICommand (MVVM-style).

WPF行为:全球应用程序快捷键