tags:

views:

87

answers:

1

Is it possible to have keyboard shourtcuts for Application Button in WPF Ribbon control?

+1  A: 

There are 2 ways:

  1. 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.

  2. 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.

Benny Jobigan