[PrismIntegration] Change theme

Docking/MDI for WPF Forum

Posted 6 years ago by Peter
Version: 12.2.0573
Avatar

Hi guys,

I just want to change the default theme AeroNormalColor to OfficeBlack. Looking into the basic Features demo, this is what I did (it compiles but doesn't work):

public partial class Shell : Window {

public Shell(){
    InitializeComponent();
    ChangeTheme(ThemeName.OfficeBlack.ToString());
}

private void ChangeTheme(string themeName) {
    ThemeManager.SetTheme(this, themeName);
    ThemeManager.SetTheme(MainRegion, themeName); //MainRegion is the name of the dockSite in PrismIntegration
}

}

Any hints to make this work ? 

[Modified 6 years ago]

Comments (3)

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

Hi Peter,

Make sure you read the "Getting Started" topic in the "Actipro Themes" area of the documentation that comes with the product.  The Office themes require an additional reference and registration call to get them working.

Also note that you should not be using the SetTheme method in production.  Instead you should set the application-wide theme via the ThemeManager.CurrentTheme property.  The SetTheme method is just intended for testing on a particular hierarchy.


Actipro Software Support

Posted 6 years ago by Alan McCormick
Avatar

I'm changing the theme to OfficeBlack with:

 

ThemesOfficeThemeCatalogRegistrar.Register();
ThemeManager.AreNativeThemesEnabled = true;
ThemeManager.CurrentTheme = ThemeName.OfficeBlack.ToString();

 

Notice this requires the OfficeThemes reference that the above mentioned. I also wouldn't take my word for it, and definitely read the tutorial on themes in the docs

Posted 6 years ago by Peter
Avatar

Thank you very much, for pointing that it's in the Help documentation. It could have helped if the code throws a message like missing DLL instead of quitely accepting SetTheme to a theme not run-time supported (although it's in the enum - you would think it is natively supported).

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.