Reputation: 1858
Is it possible to have keyboard shourtcuts for Application Button in WPF Ribbon control?
Upvotes: 7
Views: 4630
Reputation: 5304
There are 2 ways:
Use the KeyTip
property on each level of your ribbon. For example, you need to assign a KeyTip of "H" on your "Home" tab and then "A" on the "Add" button in that tab. If you don't assign KeyTips to the higher levels, you can't access the lower levels. Also, you can assign keytips to the application menu.
If you are using something like the MVVM pattern and are binding to your custom commands, you can make direct "classic" style keyboard shortcuts by binding an KeyBinding
to a command in Window.InputBindings
.
<Window.InputBindings> <KeyBinding Command="{Binding OpenWindow}" CommandParameter="About" Gesture="F1"/> </Window.InputBindings>
Ctrl+F
and such also work.
Upvotes: 14