Small problem I got. In my project I want to use key shortcuts for my buttons. There are about 5 buttons, where I want to use shortcuts. Like F1, F2, F3.
My code:
<UserControl.InputBindings>
<KeyBinding Key="F1" Command="{Binding DataContext.ZeroScaleRequestCmd, RelativeSource={RelativeSource AncestorType=weightDisplay:UCScalexWeightDisplay}}" />
<KeyBinding Key="F2" Command="{Binding TradeWeighingRequestCmd}" />
<KeyBinding Key="F3" Command="{Binding PairWeighingRequestCmd}" />
</UserControl.InputBindings>
Main problem is, these key bindings don´t react. When i click F1 it doesn´t jump inside breakpoint, or window dont open. I tried to set
Focusable = true
but it doesn´t work also. I don´t know where is mistake. If i press button by click on mouse, it work perfectly. But shortcuts not. Any ideas?