question

HemanthB-9452 avatar image
0 Votes"
HemanthB-9452 asked HemanthB-9452 commented

Change Theme of app in WinUI 3 - Windows App SDK

What is the best and working way to change the theme of a WinUI 3 App using RadioButtons programatically?
I tried searching the web but couldn't find best ways to do so.

windows-app-sdk
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Castorix31 avatar image
1 Vote"
Castorix31 answered HemanthB-9452 commented

See the Remarks section at Application.RequestedTheme Property


· 8
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Ok, so how do I restart the app programmatically?

0 Votes 0 ·

I think it is better to change the RequestedTheme of the container control
For example with a StackPanel :
(it must have Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" to be refreshed automatically)

195138-switchtheme.gif


0 Votes 0 ·
switchtheme.gif (52.6 KiB)

How do I save the settings of the theme and other stuff?

0 Votes 0 ·
Show more comments