Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1255
Theme mismatch on RibbonGroups added programatically
posted

I have a XamRibbon that has several static RibbonGroups on a Tab. On the same tab, at runtime I add several other ribbon groups with dynamic content. When I do not use the Theme property of the XamRibbon there is no problem. If I set the Theme property in xaml for the XamRibbon, the static RibbonGroups have the correct styling. The dynamically added RibbonGroups do not.

I don't see any properties on the RibbonGroup for Theme that I can set before I add these items at runtime. Is there a specific Style Key that I can use to set the RibbonGroup to look like the other RibbonGroups? I am using a custom style for RibbonGroup and the controls contained in it. Do I need to have these Styles BasedOn a specific Infragistics Style depending on the theme selected for the ribbon?

Specifically I am testing using the "Metro" style on my XamRibbon and have discovered this issue.

Thanks in advance!

Parents
  • 1255
    posted

    Sometimes when I write out questions to this forum, I figure out the answer right after because I just had to think through all the details to write it up for you...

    I was setting the style of my dynamic RibbonGroups in code before adding them. To fix the problem, I simply did the work of the style programatically setting properties and removed the style setter. Then my dynamic RibbonGroups appear with the correct styling at runtime and look the same as the static RibbonGroups.

    It might be good to know if there is an Infragistics Style resource that I could use as a BasedOn for this situation, though. But I have solved it anyway.

    Thanks for your help.

Reply Children