Problem 1
Yes, I know how to use hotkeys (XAML):
... <Window.InputBindings> <KeyBinding Key="A" Modifiers="Alt" Command="{x:Static ApplicationCommands.Close}"/> </Window.InputBindings> ... Keys just for example. The fact is that when I press, for example, Alt+B , the computer makes an error sound, and when I press Alt+A , then there is no such sound. This means that there is a “reaction” to pressing, and the window is not closed. I tried to use Gesture and changed the value of the Command attribute:
... <Window.InputBindings> <KeyBinding Gesture="Alt+A" Command="ApplicationCommands.Close"/> </Window.InputBindings> ... But nothing helps.
Problem 2
In addition, there is another problem with key modifiers ( Ctrl , Shift , Alt , Windows or None ). If I specify any modifier (in the markup), hover the cursor over the KeyBinding and look at the "Properties" panel, the modifier will be displayed there. But this does not work with Ctrl . If I take Ctrl+A instead of Alt+A (from the second markup), then nothing will appear in the Modifiers property (from the "Properties" panel). I don’t know what to say here.
I would like to solve both problems. Thank you in advance.
ApplicationCommands.Closein that context? Most likely not, put a breakpoint in it. - NewView