ThemeManager.ChangeAppStyle from separate thread doesn't take effect every 4th time #2972
Description
Hello!
When I call ThemeManager.ChangeAppStyle from a separate thread the application style is not changed every 4th time, and ThemeManager.IsThemeChanged is not called.
I have a small example to reproduce this issue.
[https://github.com/Dimigergo/MahappsThemeManager]
There is a log file, called "valami.log" which contains:
2017.05.22. 12:43:29 - Changing theme to Red
2017.05.22. 12:43:29 - Change theme: NewTheme: Red Theme changed.
2017.05.22. 12:43:34 - Changing theme to Amber
2017.05.22. 12:43:34 - Current theme from args: Amber
2017.05.22. 12:43:34 - Current theme from detection: Amber
2017.05.22. 12:43:34 - Change theme: NewTheme: Amber Theme changed.
2017.05.22. 12:43:39 - Changing theme to Emerald
2017.05.22. 12:43:39 - Current theme from args: Emerald
2017.05.22. 12:43:39 - Current theme from detection: Emerald
2017.05.22. 12:43:39 - Change theme: NewTheme: Emerald Theme changed.
2017.05.22. 12:43:44 - Changing theme to Red
2017.05.22. 12:43:44 - Current theme from args: Red
2017.05.22. 12:43:44 - Current theme from detection: Amber
2017.05.22. 12:43:44 - Change theme: NewTheme: Red Theme changed.
2017.05.22. 12:43:49 - Changing theme to Amber
2017.05.22. 12:43:49 - Change theme: NewTheme: Amber Theme changed.
2017.05.22. 12:43:54 - Changing theme to Emerald
2017.05.22. 12:43:54 - Current theme from args: Emerald
2017.05.22. 12:43:54 - Current theme from detection: Emerald
2017.05.22. 12:43:54 - Change theme: NewTheme: Emerald Theme changed.
When Current theme from args
and Current theme from detection
are appeared, the accent of the application is ok.
Environment:
Mahapps.Metro 1.5.0.23
Windows 8.1 64bit
Visual Studio 2015 Update 3
.NET Framework 4.5.1 - 4.6.1
Thanks in advance!