question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accent color doesn't change when theme changes from System Theme to HandyControl light or dark theme.

See original GitHub issue

When 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:closed
  • Created 3 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ghost1372commented, Feb 10, 2021

@SwaroopSomanna If it is possible to implement it, I provide the possibility that Return the accentcolor to its default value by setting accentColor to null

Setting accent color to null is working. Thanks.

😂😂 it’s interesting I have to add to the documentation

1reaction
ghost1372commented, Feb 9, 2021

@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😉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found