Replies: 1 comment
-
Closed due to outdated and rework of brush system after this question. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Up until now I've been using "ready-made" themes, setting them in App.xaml like so:
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/materialdesigncolor.indigo.xaml" /> <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/materialdesigncolor.amber.xaml" />
I'm now applying a custom theme instead, in the loaded event of MainWindow.xaml - using PaletteHelper.GetTheme(), setting PrimaryLight/Mid/Dark & SecondaryLight/Mid/Dark, then applying it via SetTheme().
Doing this automatically changes the foreground brush styles (eg. "PrimaryHueMidForegroundBrush"), presumably to pick a suitable contrasting colour. In my app I'm setting PrimaryMid to #2196F3, which changes "PrimaryHueMidForegroundBrush" to black. I personally think this is too dark and should be white instead, so how can I override these foreground brushes, either using PaletteHelper or some other means?
Also, changing the theme using PaletteHelper updates styles such as "PrimaryHueMidBrush", but doesn't update the 'numeric' "PrimaryNNNBrush" styles, which continue to follow the theme configured in App.xaml. Is there a way to update these to match the custom theme set using PaletteHelper?
Lastly, I'm using MahApps, but the window title bar background continues to use the primary theme in App.xaml, and not what I've set via PaletteHelper. Is there a way to get MahApps to use my custom theme?
Beta Was this translation helpful? Give feedback.
All reactions