Setting the backstage close button tint color

Ribbon for WPF Forum

Posted 11 years ago by Paul Wilde - Senior Developer, Exponential Limited
Version: 12.2.0571
Avatar

I'm using the tinting feature to set the background color of the application button and backstage to a custom color (we have a couple of different apps within our suite and so being able to differentiate them by color ala Office is just awesome). I don't want to touch the rest of the ribbon coloring, we want to keep that standard across our UIs. It's working great, except the backstage close button isn't being tinted, presumably because I'm not setting it's tint group key - what is it? It's not defined in TintGroupSets.All (that I can see, anyway).


// Build a color-tinted theme
TintedThemeCatalog catalog = new TintedThemeCatalog("Green", ThemeName.MetroLight.ToString());
catalog.TintGroups.AddRange(TintGroupSets.ApplicationMenu, Colors.Green);
catalog.TintGroups.AddRange(new string[] { "BackstageButton", "BackstageTabControl", "BackstageHeaderSeparator", "<nameofthebackstageclosebuttonhere>" }, Colors.Green);
ThemeManager.RegisterThemeCatalog("Green", catalog);

// Apply the theme to a Ribbon
ThemeManager.SetTheme(MainRibbon, "Green");

Comments (3)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Paul,

While looking into this we discovered that several tint group settings were missing within the ApplicationMenu tint group set.  We've corrected that for the next maintenance release so your second AddRange won't be needed.  Note that the BackstageButton is still excluded though since that doesn't normally want to be tinted (it uses silvers).

The main problem you are seeing is that you are setting resources on the ribbon (which you don't normally want to do anyhow except for testing).  If you change the line to this, it will work:

ThemeManager.CurrentTheme = "Green";

The reason is that the Backstage close button is actually part of the RibbonWindow template.  So Ribbon's resources don't affect it.


Actipro Software Support

Posted 11 years ago by Paul Wilde - Senior Developer, Exponential Limited
Avatar

That did the trick - thanks again :)

Posted 11 years ago by keepITcool - Amsterdam
Avatar

Just installed 573... but assets in MetroWhite still awfully empty...

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.