Posted 8 years ago by Keith I
Version: 11.2.0550
Avatar
Hi,

My application has a 'Change Theme' button in the same way as the Sample Browser. When selecting a theme I set ThemeManager.CurrentTheme. This works for all of the themes except AeroNormalColor (which works for me in the Sample Browser).

I have added a reference to the Office theme dll (and called ThemesOfficeThemeCatalogRegistrar.Register), but other than that I don't do anything other than setting ThemeManager.CurrentTheme. Am I missing something?

Keith

Comments (3)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Keith,

If you can please put together a small sample project that reproduces your issue and email it over then we can take a closer look. Be sure to remove any executables or change the extension of the zip file to ensure it gets past our email filters.


Actipro Software Support

Posted 8 years ago by Keith I
Avatar
Hi,

I've managed to find the problem. It comes to down to where you place the following line:
ThemeManager.AreNativeThemesEnabled = true;
If you put it before the InitializeComponent call in the MainWindow constructor (or in OnStartup override in App.xaml.cs) then it works. Put it after InitializeComponent and it fails to set the Aero theme (other themes work OK).

If you don't set AreNativeThemesEnabled at all then it fails to set the Aero theme.

If you don't set AreNativeThemesEnabled but call ThemesOfficeThemeCatalogRegistrar.Register before InitializeComponent then it works. Call ThemesOfficeThemeCatalogRegistrar.Register after InitializeComponent and it fails.

Obviously the workaround here is easy; I can just set AreNativeThemesEnabled earlier.

Regards,
Keith
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Keith,

I'm a little unclear about all the cases you are referring to. But please refer to our Sample Browser and documentation for the best way to configure the application-wide themes (which should be done in OnStartup of your Application).


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 12 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.