Accent color doesn't change when theme changes from System Theme to HandyControl light or dark theme.
See original GitHub issueWhen I switch the app theme from HandyControl light or dark theme to System Theme the accent color in my app changes to match the system accent color. But when I change back the app theme from System Theme to HandyControl light or dark theme the accent color remains the same. I mean the accent color is set to System Accent color and not the default accent color for HandyControl light or dark theme.
Below is the code I’m using to switch themes with the click of radio buttons:
private void RadioButtonThemeLight_Click(object sender, System.Windows.RoutedEventArgs e)
{
ThemeResources.Current.UsingSystemTheme = false;
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
}
private void RadioButtonThemeDark_Click(object sender, System.Windows.RoutedEventArgs e)
{
ThemeResources.Current.UsingSystemTheme = false;
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
}
private void RadioButtonThemeWinDefault_Click(object sender, System.Windows.RoutedEventArgs e)
{
ThemeResources.Current.UsingSystemTheme = true;
ThemeManager.Current.ApplicationTheme = ThemeManager.GetSystemTheme();
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Theme
All classes related to Theme Located in the HandyControl. ... By changing the Windows theme (Light/Dark and Accent Color), the theme of the...
Read more >Dark theme doesn't change window style · Issue #1357
Describe the bug If you turn on the dark theme, the window will remain light Steps to reproduce the bug Create project Add...
Read more >[Bug] Accent Color and System Theme changes are not ...
The cause seems to be UISettings doesn't raise any events in a packaged app, although its methods and properties work fine. Does the...
Read more >Respond to system theme changes - .NET MAUI
In this example, the background color of the Grid and the Button style changes based on whether the device is using its light...
Read more >ThemeManager does not change the style of the control
When I apply the new accent the text color change, but for example ... virtual void DoChangeTheme(object sender) { var theme = ThemeManager....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
😂😂 it’s interesting I have to add to the documentation
@SwaroopSomanna I know, I said from now this will be done automatically and there will be no need to write additional code😅 The image I posted showed the modified Commit function. In version 3.1.0 you wrote the correct code, but for the next version this process has been modified😉