I would like to associate a Keyword Shortcut to the ApplicationMenuItem like you can associate with a Button.
If we would do:
<igRibbon:ButtonTool Name="test" Caption="T_est" Command="{Binding MyCommand}"/>
That Button gets the "Alt+E" shortcut associated. By simply adding an Underscore to the Caption of the Button.
How can we accomplish the same with the ApplicationMenu2010Item, but when we do:
<igRibbon:ApplicationMenu2010Item Name="test" Header="T_est" Command="{Binding MyCommand}" ></igRibbon:ApplicationMenu2010Item>
The Application shows the text of the item with the underscore. Although It seems that it does assign the shortcut.
What is the correct way to achieve what we want?
Hello,
Thank you for your post. I have been looking into the functionality that you are trying to achieve and what I can suggest is using key tips for the ApplicationMenu2010Item. The ApplicationMenu2010Item provides a KeyTip to property and when that property is set and you press the Alt key while the menu is the key tips are appearing and you can execute the command on the menu item by pressing the key of the KeyTip. You can read more detailed information regarding the KeyTips to the Application 2010 Menu here: http://help.infragistics.com/NetAdvantage/WPF/current/CLR4.0/?page=xamRibbon_ApplicationMenu2010KeyTips.html. Also I have created a sample application for you, that shows how you can use the key tips.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hi Krasimir,
That worked great! I was searching for something like that but I could not find it. However my issue it is a bit more complicated. We thought we could solve it with the approach I was taking in my first post but that is not the case.
Basically I would like the ApplicationMenu2010Item to be a Quick Access Menu Item too, but I could not find a property to that effect.
So we were doing something like this:
<igRibbon:ApplicationMenu2010Item Name="test" Header="T_est" Command="{Binding MyCommand}" > <igRibbon:ApplicationMenu2010Item.Header> <igRibbon:ButtonTool Name="test" Caption="T_est" IsQatCommonTool="True" Command="{Binding MyCommand}"/> </igRibbon:ApplicationMenu2010Item.Header></igRibbon:ApplicationMenu2010Item>
This works, we get the KeyTip by using the underscore and the button is part of the QuickAccess Bar, but when the button is disabled you can still click on it. It doesnt run the action, it just hides the Backstage.
I don't konw what is the best way to go about all this, what would you recommend?
I am adding a Zip which has 3 images showing you the issues we are having:
Additionally I updated the sample solution you provided me to show you the issues I am talking about. There is a backstage item "Toggle Test" that enables and disables the "Test" item of The backstage.
Thanks in advance!
Thank you for your reply and the clarifications on the issues that you are having. Since the ApplicationMenu2010Items cannot be added to the QAT, you can use the approach that you are currently using. Regarding the issues that you are having:
<igWPF:ApplicationMenu2010Item
Command="{Binding TestCommand}" >
<igWPF:ApplicationMenu2010Item.Header>
<igWPF:ButtonTool
Name="appTest"
IsQatCommonTool="True"
Caption="T_est"
Command="{Binding TestCommand}"/>
</igWPF:ApplicationMenu2010Item.Header>
</igWPF:ApplicationMenu2010Item>
If you remove that property from the definition of the ButtonTool or set it to false, the “Test” will not appear in the QAT by default.
Regarding the third issue that you are having, the reason for the underscore to appear is that the ContentPresenter that is used in the ApplicationMenu2010Item does not have its RecognizesAccessKey property set to True. In order to hide the underscore, you can re-template the ApplicationMenu2010Item and set the
<ControlTemplate TargetType="igRibbon:ApplicationMenu2010Item"
x:Key="{x:Static igRibbon:ApplicationMenu2010Item.ButtonTemplateKey}">
………….
<ContentPresenter
Grid.Column="1"
ContentSource="Header"
RecognizesAccessKey="True"
igRibbon:XamRibbon.KeyTipPlacementType="Caption" />
</ControlTemplate>
I have modified the sample application that you have attached to implement the mentioned changes. Also I have logged the third behavior with our developers in our tracking system, with an issue ID of 149177. I have also created a support ticket on your behalf with number CAS-121695-J4S2L7in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.
Krasimir, thanks a lot for the time you have taken into this issue.
About your comments:
The First Issue: Yes we realized why the item could be selected, but since this is a very common feature in many wpf applications. For example, is very common to have a Save button in the Backstage and in the Quick Access Bar. And I have never seen that you could still click a button in the backstage when it was disabled.
I dont quite understand how is that putting the Command in two places it fires only once, would you mind explaining me? I am sure I am not seeing something.
The Second Issue: I think this was no issue. We want the buttons to appear in the Quick Access Bar, so that is why I was showing you what we wanted to accomplish. Or is that I misunderstood something you said?
The third issue: I see, I mostly reported it because although you mentioned the KeyTip, the behavior still seemed buggy to me. Thanks for oppening the case!
So I just would like to understand why the Command fires only once, and if this is the only way to achieve what we want: To have a button both in the Quick Access bar and the Backstage.
Thank you for your reply. Please let me know if you need any further assistance on the matter.
Krasimir, MCPD
Developer Support Supervisor - XAML
Thanks a lot! When we update to that version I will test how it works.
The development issue with ID of 149177has been fixed and it is available in the latest Service Release. You can download the Service Release by logging in our web site and then going to Account\Keys and Downloads page.
Thank you for using Infragistics Components.