Question

Changning the colour of the file tab

Posted 3 years ago by Avatar Aimee
Hi,

I have a ribbon with a backstage such as:

<ribbon:Ribbon.ApplicationMenu>
<ribbon:Backstage>
<ribbon:Backstage.Background>
<ImageBrush ImageSource="MyImage.png"/>
</ribbon:Backstage.Background>
<ribbon:Button Label="Save" Command="{Binding SaveChangesCommand}" />
etc

How do I change the colour of the file tab? It is currently blue like Word, but would like to make it green like Excel, or purple like OneNote.

I am using the Office2010Silver as my theme. Is this a change of theme or a simple backstage setting change?

Cheers

Comments (7)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Aimee,

I'm sorry but at this time you'd have to retemplate the ApplicationButton control to do different colors since we don't include any other variants. The default templates are available for download from your account if you are a WPF Studio customer. You can clone the scenic application button style and modify it for whichever color you need.

Actipro Software Support
Posted 3 years ago by Aimee
Thanks for your help. I have looked at the theme templates and can see the ApplicatioButton that I want to change in the Ribbon/Themes/Ribbon/Common/ApplicationButton.xaml file.

I have found the brush (ApplicationButtonOuterBackgroundNormalBrushKey) in the Office2010CommonBrushes.xaml (I am using the Office 2010 Silver theme) file and made of copy of this and put it in my style resource file for my project. I have then tried to change the colour, but it doesn't seem to work.

I have tried adding various other brushes from that file, as well as the whole ApplicationButton template from the ApplicationButton.xaml file and tried to change the colours but none of these seem to be overriding the default theme styles.

Am I doing something stupidly wrong? They should just work in my application.resource file, shouldn't they?

Cheers
Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Aimee,

If I add this to my Application.Resources it shows up properly for my Scenic style app button:
<SolidColorBrush x:Key="{x:Static themes:RibbonCommonDictionary.ApplicationButtonOuterBackgroundNormalBrushKey}" Color="Red" />

Actipro Software Support
Posted 3 years ago by Aimee
Hi,

I just tried your line of code and it didn't work. But then I took it out of my external application.resources file and added it directly into my main window resources and it has worked.

So I clearly need to do it directly into the page.

Many thanks for you help.
Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
It should work in the application resources as well, and it is a better place to have it.

Hmm, are you perhaps setting the ThemeManager.Theme attached property on your Window? You should never do that in production applications since that will load the resources for that theme at that point (the Window) instead of at the application level. Thus if you ever do it more than one time that way (in other windows), you load up more resources in memory.

It's always better to just set the static ThemeManager.CurrentTheme property in your application startup instead since that will only load the resources into the application level.

Actipro Software Support
Posted 3 years ago by Aimee
Ah, that makes sense. I will change where that is set, as you were right, it is in my window.

Many thanks for your help.
Posted 3 years ago by Aimee
Just to update you. I removed the thememanager from my main window and stuck this in my app.xaml.cs file instead:
ThemeManager.CurrentTheme = CommonThemeName.Office2010Silver.ToString();
And now the application button colour changes magically work in my external application.resource file!!!

Thanks for the advice.

[Modified at 09/16/2011 08:29 AM]
Information The latest build of this product (2014.2 build 0610) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.