I'm attempting to add a ButtonTool to the quick access toolbar but nothing is showing up. What I would really like to do is add the ButtonTool to the ribbon's ToolsNotInRibbon collection so that the tool only shows up in the QAT. I've attached a sample project that illustrates my problem. The relevant code is in the MainWindowView.xaml.cs in the GetRibbonTabItem to show the ToolsNotInRibbon problem and the HostRibbon_OnLoaded that shows the issue with it not showing when added as a normal ButtonTool.QuickAccess.zip
Hello Collin,
I have been investigating the sample project you have provided, and it appears that the reason that you are unable to add your ButtonTool to the QuickAccessToolbar in your sample is due to a timing issue. Currently, on my end, the sample you have provided actually crashes as a result of trying to add your QatPlaceholderTool in the HostRibbon_OnLoaded event, but if I surround the code in this event in a Dispatcher.BeginInvoke action, everything is working normally. I am unsure if you are currently seeing this crash or not.
With the above said, you should be able to add the ButtonTool to the ToolsNotInRibbon collection of the XamRibbon and still have them show up in the QAT. I have modified the sample project that you have sent me such that this is now the case and am attaching it here.
It is also worth noting that it appears that you are using the version-free assemblies and so I cannot be sure which version you are actually using in this case. My tests were made against version 18.1.20181.255 in Infragistics for WPF 2018.1.
I hope this helps. Please let me know if you have any other questions or concerns on this matter.
2626.QuickAccess.zip
Andrew,
While this approach works it requires too intimate knowledge of tab, ribbon group and button layout to be useful in the long run. The HostRibbon_OnLoaded method was only present for illustration purposes and I was hoping to make it go away completely. I wanted to be able to handle all the tab, ribbon group and button creation in the GetRibbonTabItem method. The original project contained the call to ToolsNotInRibbon.Add (commented out) in that method that illustrated the problem I'm trying to overcome. I tried surrounding the call with the BeginInvoke block with no success. Is it not possible to make this call in this situation? Also, I did not see the crash you describe, version 17.2.20172.2029. We are planning to update soon.