Change Window Theme

1 Answer 35 Views
RibbonView and RibbonWindow
Miles
Top achievements
Rank 1
Miles asked on 26 Jun 2022, 03:14 AM

Hi

 

I've setup a simple project using a RadRibbonWindow with a ribbon and a few controls. I'm trying to toggle between Light and Dark themes using the StyleManager which is working for the controls but not the Window (Title bar etc).

 

I've gone through a few articles including this one and threads on the forum including this one. Unfortunately I can't get the Window to change theme. Any help would be much appreciated.

 

Thanks Miles

1 Answer, 1 is accepted

Sort by
1
Accepted
Vicky
Telerik team
answered on 27 Jun 2022, 10:47 AM | edited on 27 Jun 2022, 10:47 AM

Hi Miles,

Thank you for choosing the RadRibbonWindow control!

Generally speaking, using the StyleManager approach requires forcing the controls to be reinitialized after changing the theme. That is why when changing themes during runtime we suggest using the implicit styling approach with the NoXaml dlls. You can check out the Switching Themes at Runtime article which elaborates on this scenario.

I prepared a sample project for your convenience which demonstrates the NoXaml approach. You can find it attached to my reply.
P.S. It uses our latest Windows 11 theme.

Here is a preview of the end result:

Miles
Top achievements
Rank 1
commented on 28 Jun 2022, 02:25 AM

Hi Vicky

 

Thanks for the reply, I managed to build and run your example, it worked as expected. When I reverse engineered your example into my example had a few problems, eventually worked out the IsWindowThemeEnabled needed setting to false then was all good.

 

Many Thanks

Miles

 

Tags
RibbonView and RibbonWindow
Asked by
Miles
Top achievements
Rank 1
Answers by
Vicky
Telerik team
Share this question
or