Skip to content

Text Color Not Inverting in Dark and Light Theme #4098

Answered by timunie
sarsw asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @sarsw

try this:

private void ColorPicker_SelectedColorChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<System.Windows.Media.Color?> e)
{
    App.Current.Resources["MahApps.Brushes.Text"] = new SolidColorBrush(e.NewValue ?? Colors.Black);
    App.Current.Resources["MahApps.Brushes.ThemeForeground"] = new SolidColorBrush(e.NewValue ?? Colors.Black);
}

result:

I found the needed keys here:

<SolidColorBrush x:Key="MahApps.Brushes.ThemeBackground" Color="{StaticResource MahApps.Colors.ThemeBackground}" options:Freeze="True" />
<SolidColorBrush x:Key="MahApps.Bru…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by sarsw
Comment options

You must be logged in to vote
0 replies
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