How to run RoutedCommand at the application level in multiple window templates?

I have several windows in the application, for example window1, window2 and window3.

one RoutedCommand (with KeyGesture F11) was bound in window1. How to run this routed command by pressing F11 while window2 has input focus?

In a WinForm application, I use MessageFilter to detect F11, but in WPF, how do I do this?

+3
source share
1 answer

CommandManager.RegisterClassCommandBinding, . , , App.xaml.cs, .

CommandManager.RegisterClassCommandBinding(typeof(Window), new CommandBinding(ApplicationCommands.Cut, CutExecuted));
+2

Source: https://habr.com/ru/post/1753439/


All Articles