Skip to content

Set "Text on primary" to White when Dark mode is enabled #3514

Closed Answered by Keboo
Todilo asked this question in Q&A
Discussion options

You must be logged in to vote

So it depends a little bit on the scope that you want to apply it at.

First, if you just apply the default window style Style="{StaticResource MaterialDesignWindow}" to your windows you will get the basic theming support that toggles the foreground and background colors based on the theme.

Assuming you have done that, then the brush that is setting the default text color is TextElement.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}". This is the default foreground color that is applied to all controls in the demo app.

If, instead you are looking to just change the foreground color for the "Primary" theme colors. You can do something like this in your code to directly manipu…

Replies: 1 comment 1 reply

Comment options

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

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