Skip to content

Proper way to switch Dark/Light theme #5347

Answered by pr8x
derekantrican asked this question in Q&A
Discussion options

You must be logged in to vote

With the new Fluent theme you can just simply do: new FluentTheme { Mode = FluentThemeMode.Dark } instead of manually including the URI. Unfortunately this only works with fluent and not the default theme.
I think you only need to update the styles on the Application not the windows, that should already be enough. Although switching themes at runtime is sometimes a bit cumbersome. I ended up restarting the window to have everything update correctly (Not sure if there's a ticket for this somewhere).

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@jp2masa
Comment options

@derekantrican
Comment options

@derekantrican
Comment options

@maxkatz6
Comment options

Answer selected by derekantrican
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zalito12
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants