-
How do I change the standard text color of black to white for "Text on primary". Like you can do in the demo application? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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 Assuming you have done that, then the brush that is setting the default text color is 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 manipulate the theme colors. PaletteHelper paletteHelper = new PaletteHelper();
Theme theme = paletteHelper.GetTheme();
theme.PrimaryLight = new ColorPair(theme.PrimaryLight.Color, Colors.White);
theme.PrimaryMid = new ColorPair(theme.PrimaryMid.Color, Colors.White);
theme.PrimaryDark = new ColorPair(theme.PrimaryDark.Color, Colors.White);
paletteHelper.SetTheme(theme); The second parameter to the |
Beta Was this translation helpful? Give feedback.
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…