There seems to a problem when you have a Button both in the Quick Access Bar in the Backstage.
We got a Button, we call it "Test Button", in the backstage and in the QuickAccess bar, associated with a RelayCommand. Additionally we have a "Toggle" Button in a Tab of the Dockmanager and in the Backstage.
The toggle button changes the state of the Test Button.
To reproduce the error follow this steps in the attached sample app:
To be able to enable back a button in the Quick Access Bar you need to show and hide the Backstage, that is the only way the state of the button gets refreshed.
Basically if the buttons gets disabled from the Backstage it is not possible to enable it from outside the backstage.
We would like to fix this issue, any comments will be greatly appreciated.
Thanks!
Hello,
I have been looking into your post. I have contacted out development team regarding this scenario.
The reason is that the ApplicationMenu2010Item is associated with the same command. Since the ApplicationMenu2010Item only matters when the ApplicationMenu2010 is actually shown the menu item does not verify its IsEnabled state (it does not query the commands CanExecute until its next measure, which happens when the menu is displayed. The ButtonTool that is on the QAT has its IsEnabled bound to the IsEnabled of the source tool (in this case that is the tool that is within the Application2010MenuItems Header). Since the ApplicationMenu2010Item was disabled (because the associated command was disabled and it is not updating its IsEnabled state until the next time it is shown) the descendant elements are disabled (because WPF will disable any descendant of a disabled element) and that includes the ButtonTool that is within the Header.
A possible solution for this issue is to associate the ApplicationMenu2010Item with the Command and set the Header as needed (setting it to the Caption of the ButtonTool) and then just add the ButtonTool to the ToolsNotInRibbon. Here is a link, where you can find more information about this functionality: http://help.infragistics.com/Help/NetAdvantage/WPF/2012.1/CLR4.0/html/InfragisticsWPF4.Ribbon.v12.1~Infragistics.Windows.Ribbon.XamRibbon~ToolsNotInRibbon.html.
Please do not hesitate to let me know if you have any further questions on the matter.
Hi Gergana,
The QAT items are not only being updated after the ApplicationMenu is closed. If you toggle the button state from the Tab without ever going to the ApplicationMenu it works just fine. But when you start using the Application Menu it stops working. This seems to me a bug like behavior, because it is not consistent.
I have noticed that when you are inside the ApplicationMenu the the QAT bar is disabled, so it makes sense when you say the QAT bar is only updated after the QAT is closed.
The problem here is that I change the state of a QAT button from outside the ApplicationMenu, and the only way i have to update its state is to open and close again the ApplicationMenu. That is not a consistent behavior.
Any insights you could give me will be greatly appreciated.
Thank you for your post. I have been looking into it. To update the items in the QAT after the ApplicationMenu is closed is the default behavior of the xamRibbon. This is one of the Microsoft requirements about the Ribbon.