I have a button that has the following commands:
<Window.Resources>
<RoutedUICommand x:Key="CommandPretraga"/>
</Window.Resources>
<Window.CommandBindings>
<CommandBinding Command="{StaticResource CommandPretraga}" Executed="chkPretraga_Click" />
</Window.CommandBindings>
<Window.InputBindings>
<KeyBinding Key="ENTER" Command="{StaticResource CommandPretraga}" />
</Window.InputBindings>
The shortcut works if called from most of the window, but if I'm currently in one of my TextBox
elements, the shortcut doesn't work. I'm guessing that this is because the TextBox
is registering and processing the ENTER key event, and I tried catching that and calling the same function the shortcut is supposed to call, but that didn't work.
How can I solve this?