You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a WPF project that involves changing theme dynamically at runtime based on Light/Dark/High Contrast mode and I am trying to use ThemeManager for it.
I have added four custom themes Light.Accent1, Dark.Accent1, HC.Light.Accent1 and HC.Dark.Accent1 as given below :
Code to auto sync theme with current system colors :
ThemeManager.Current.AddLibraryTheme(new LibraryTheme(
new Uri("pack://application:,,,/Light.Accent1.xaml"),
MahAppsLibraryThemeProvider.DefaultInstance));
ThemeManager.Current.AddLibraryTheme(new LibraryTheme(
new Uri("pack://application:,,,/Dark.Accent1.xaml"),
MahAppsLibraryThemeProvider.DefaultInstance));
ThemeManager.Current.AddLibraryTheme(new LibraryTheme(
new Uri("pack://application:,,,/HC.Dark.Accent1.xaml"),
MahAppsLibraryThemeProvider.DefaultInstance));
ThemeManager.Current.AddLibraryTheme(new LibraryTheme(
new Uri("pack://application:,,,/HC.Light.Accent1.xaml"),
MahAppsLibraryThemeProvider.DefaultInstance));
ThemeManager.Current.ChangeTheme(this, "Light.Accent1");
ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncWithAppMode;
ThemeManager.Current.SyncTheme(ThemeSyncMode.SyncWithAppMode);
The detection works fine in automatically syncing themes when system colors change from Light to Dark mode and vice versa. But turning on High contrast mode doesn't change to corresponding theme i.e HC.Light.Accent1 and HC.Dark.Accent1
Is there something I am missing?
The text was updated successfully, but these errors were encountered:
I am working on a WPF project that involves changing theme dynamically at runtime based on Light/Dark/High Contrast mode and I am trying to use
ThemeManager
for it.I have added four custom themes
Light.Accent1
,Dark.Accent1
,HC.Light.Accent1
andHC.Dark.Accent1
as given below :Light.Accent1
Dark.Accent1
HC.Light.Accent1
HC.Dark.Accent1
Code to auto sync theme with current system colors :
The detection works fine in automatically syncing themes when system colors change from
Light
toDark
mode and vice versa. But turning on High contrast mode doesn't change to corresponding theme i.eHC.Light.Accent1
andHC.Dark.Accent1
Is there something I am missing?
The text was updated successfully, but these errors were encountered: