How to change ribbon menu dynamically

Good morning,

my goal is to have one main ribbon menu in main page with some control (as ApplicationMenu, QuickAccessToolbar) that are alway the same and can change the ribbon tab depending on an event (click on item in treeview) as do outlook that change ribbon menu for mail, for contacts, for agends.
I want to seclect one ribbon style and hold this style for every ribbon elements.
Which is the best practicies?

Thanks.

Roberto

11 Replies 1 reply marked as answer

VR Vijayalakshmi Roopkumar Syncfusion Team March 1, 2021 10:26 AM UTC

Hi Roberto,  
 
Thank you for using Syncfusion Products. 
 
Query : I want to seclect one ribbon style and hold this style for every ribbon elements.Which is the best practicies? 
 
Once you set the Ribbon style at the RibbonWindow using VisualStyle or SetTheme property, then the style would apply for all the elements in Ribbon.  You can refer about this in the following UG link: 
 
 
 
For more information about themes and Skinmanager, you can refer the following UG link: 
 
 
Please try this solution and let us know if it is helpful. 
 
Regards, 
Vijayalakshmi VR 



RB Roberto Becchetti March 1, 2021 08:43 PM UTC

Thanks for answer. My first goal is to have the ribbon menu in the MainWindow that change dynamically by click the TreeViewItem. For do this I have tried to use contentcontrol in mainwindow and in c# I set to Contentcontrol.Content the specific RibbonMenu (defined in an UserControl: RibbonUserControl1, RibbonUserControl2 , etc...). Each Ribbon menu have the same ApplicationMenu and QuickAccessToolbar but have different RibbonTan,RibbonBar and RibbonButton.
I would want to find the best way to have different Ribbon Object that contain tabs but one common ApplicationMenu and QuickAccessToolbar. So I want to merge one common Ribbon menu with second (specific) ribbon menu that contains RibbonTabs.

Thanks.

Roberto  


EM Elakkiya Muthukumarasamy Syncfusion Team March 2, 2021 10:39 AM UTC

Hi Roberto, 

We have checked your query “want to merge one common Ribbon menu with second (specific) ribbon menu that contains RibbonTabs” and we would like to let you know that you can be able to merge common Ribbon menu with second (specific) ribbon menu. Please refer the below help documentation link for the same and the refer sample link added this link. 


Please refer the above documentation link and let us know if you need any further assistance on this. 

 Regards, 
Elakkiya 


Marked as answer

RB Roberto Becchetti March 3, 2021 05:37 PM UTC

Thanks for the answer and for the solution. It was what I was looking for. 

Best regards

Roberto


VR Vijayalakshmi Roopkumar Syncfusion Team March 4, 2021 05:31 AM UTC

Hi Roberto 
 
Thank you for your update. 
 
We are glad that our solution helps to achieve your requirement. 
 
Please let us know if you need any other assistance on this. 
 
Regards, 
Vijayalakshmi VR 



RB Roberto Becchetti March 6, 2021 07:34 AM UTC

I have another doubt. 
If I add 
        xmlns:syncfusionskin="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF"
        syncfusionskin:SfSkinManager.VisualStyle="Office2016White"
in RibbonWindow and add Ribbon I have the correct skin but if I insert a RibbonWindow.Resources I lost the skin and appears the default skin.

How do I make for keeping the Office2016White skin?

Thanks.

Roberto


VR Vijayalakshmi Roopkumar Syncfusion Team March 8, 2021 12:53 PM UTC

Hi Roberto  
  
 
Thank you for your update. 
  
Query : in RibbonWindow and add Ribbon I have the correct skin but if I insert a RibbonWindow.Resources I lost the skin and appears the default skin. 
   
When you apply the theme along with RibbonWindow resources , the theme will merge in to ribbonwindow resources and it will apply properly. So could you provide us the details such as how do you using RibbonWindow resource and if possible please send us the code that depicts RibbonWindow resource usage in your application or any reproducible sample, it would be helpful for us to provide you the accurate solution on this.  
  
Please let us know if you need any other assistance on this. 
  
Regards, 
Vijayalakshmi VR 



RB Roberto Becchetti March 9, 2021 09:36 PM UTC

Good morning,

in the attach file there is a simple project with ribbon merge example. If I comment syncfusion:RibbonWindow.Resources I see the Office2016White correctly otherwise I see the default ribbon style.

Where is the problem?

Thanks.

Roberto

Attachment: Test_10040369.rar


VR Vijayalakshmi Roopkumar Syncfusion Team March 11, 2021 12:18 AM UTC

Hi Roberto, 
 
Thank you for your update. 
 
We have tried to reproduce the reported behavior "Theme does not applied properly on applying the office2019theme" and we could found that you are merging the resource dictionary in sample level after applying the theme as in the following code: 
 
Code:[XAML] 
 
 
<ResourceDictionary> 
<ResourceDictionary.MergedDictionaries> 
<ResourceDictionary Source = "IconsDict.xaml" /> 
</ResourceDictionary.MergedDictionaries> 
</ResourceDictionary> 
 
 
As you are implementing this code, it will take the default style and it will override the applied theme. So only the applied theme does not reflected properly for RibbonWindow. So we request you to remove this line of code and recommend you to merge this dictionary in app.xaml as in your modified sample and it can be downloaded from following location: 
 
 
Screenshot: 
 
 
 
Please try this suggestion and let us know if it is helpful. 
 
Regards, 
Vijayalakshmi VR 



RB Roberto Becchetti March 11, 2021 10:33 PM UTC

Ok. 

Thanks for suggestion.

Roberto


VR Vijayalakshmi Roopkumar Syncfusion Team March 12, 2021 04:08 AM UTC

Hi Roberto 
 
Thank you for your update. 
 
Please let us know if you need any other assistance on this. 
 
Regards, 
Vijayalakshmi VR 


Loader.
Up arrow icon