Splitting the Ribbon controls in separate files breaks the QAT functionality.

Ribbon for WPF Forum

Posted 7 months ago by Daniel Constantin - ModuleWorks GmbH
Version: 23.1.3
Avatar

Hi!

Because I had a very big file I split the Ribbon into multiple files so I created several ribbon:Tab controls and inside every tab there are multiple ribbon:Group controls. Everything works ok until I try to add a ribbon button to the QAT and restart the application.

Right before I add the button to the QAT it works but after restart and reload the serialized QAT file, that button from the QAT does nothing. Like it loses all the bindings. From what I saw I think that maybe inside the “RibbonControlPath” it writes a bad Type.

For the ribbon button there is Type="ribbon:Button" but for my custom ribbon group it is “ Type="mwmsguivts:ViewsGroup" ”.

Kind regards,

Daniel

Comments (2)

Posted 7 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

It seems this is because I have in place bindings to DataContext like DataContext="{Binding TestTab}" or DataContext="{Binding TestGroup}" and somehow the QAT RibbonControlPath searches using the MainViewModel.

It seems that I need the full path inside the button bindings and not like I am doing here.

[Modified 7 months ago]

Answer - Posted 7 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Daniel,

The QAT serialization logic will try to locate a set of path items to point to another control already in the Ribbon with the same Id if it can.  If one is found, it will try to use the CloneService to clone that existing control within the ribbon on QAT layout deserialization.  It's a good idea to assign Id property values in all controls that can be placed in the QAT if you will be doing QAT serialization.

If it is unable to serialize a full path to a control, it will try to serialize an element instance instead.  For that it will use XamlSerializer to write out the XAML of the control to a string, and will use XamlSerializer to load later on as well.  Things like Bindings will not serialize properly with XamlSerializer and it will serialize the binding's resolved value instead.

This all is another area where our newer Bars ribbon control implementation is much improved, especially when using MVVM.  With that, it creates a simple minimal string for QAT serialization that doesn't run into any of these issues.


Actipro Software Support

The latest build of this product (v24.1.2) was released 7 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.