Adding Keyboard Shortcut to Backstage Command Button

I have a working <syncfusion:BackStateCommandButton ... in my Ribbon window. It is successfully bound via Command binding.

I would like to add a keyboard shortcut. Normally in WPF you use InputBindings

However, the follow is not bound in the WPF Backstage of the Ribbon

<syncfusion:BackStageCommandButton Header="Close" Command="{Binding CloseFileCommand}" 
                                                           IsEnabled="{Binding DocumentsVisible}"
                                                            >
                            <syncfusion:BackStageCommandButton.InputBindings>
                                <KeyBinding Key="w" Modifiers="Ctrl" Command="{Binding CloseFileCommand}"/>
                            </syncfusion:BackStageCommandButton.InputBindings>

1 Reply 1 reply marked as answer

EM Elakkiya Muthukumarasamy Syncfusion Team March 22, 2021 10:21 AM UTC

Hi Nick, 
 
Greetings from Syncfusion. 
 
We have checked your query “Adding Keyboard Shortcut to Backstage Command Button” and we would like to let you know that you can achieve this by using KeyTip support instead of InputBindings. To invoke any command using KeyBoard, Ribbon control provides KeyTip support to access the RibbonItem. On pressing Alt key, KeyTips for the corresponding RibbonItem gets displayed. 
 
Please refer the sample and code snippet for the same. 
 
Code snippet: 
 
<syncfusion:Ribbon.BackStage> 
<syncfusion:Backstage syncfusion:Ribbon.KeyTip="B"> 
<syncfusion:BackstageTabItem syncfusion:Ribbon.KeyTip="I" Header="Info"/> 
<syncfusion:BackStageCommandButton Header="SaveAs" Command="{Binding SaveAsCommand}" syncfusion:Ribbon.KeyTip="S" /> 
<syncfusion:BackStageCommandButton Header="Open"  Command="{Binding OpenCommand}" syncfusion:Ribbon.KeyTip="O"/> 
<syncfusion:BackStageCommandButton Header="Close" Command="{Binding CloseCommand}" syncfusion:Ribbon.KeyTip="C" /> 
<syncfusion:BackStageCommandButton Header="Print" Command="{Binding PrintCommand}" syncfusion:Ribbon.KeyTip="P"/> 
</syncfusion:Backstage> 
</syncfusion:Ribbon.BackStage> 
 
 
 
Output: 
 
 
 
Please try it with the provided solution and let us know if you need any further assistance on this. We will be glad to assist you. 
 
Regards, 
Elakkiya 


Marked as answer
Loader.
Up arrow icon