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
If you attempt to call ApplicationThemeManager from a different thread a InvalidOperationException is raised detailing that "The calling thread cannot access this object because a different thread owns it.". This exception appears within the ApplyDefaultWindowBorder method of the ClientBorder control. This appears to be isolated to Windows 10 only, because of the operating version check before hand.
There is no guarantee the the ThemeChanged event was raised on the thread, so I only can think that we should be doing a thread safety check and ensuring that we are on the UI thread before updating the UI.
To Reproduce
Assume that you are running on a variant of Windows 10.
Access and call ApplicationThemeManager.Apply from a different thread other than the UI thread.
Expected behavior
It should be possible to switch theme from a different thread, ensuring that there were thread safety checks done at the place of applying the UI changes.
Screenshots
OS version
Windows 10 21H2
.NET version
.net 8.0
WPF-UI NuGet version
3.0.4
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
If you attempt to call
ApplicationThemeManager
from a different thread aInvalidOperationException
is raised detailing that "The calling thread cannot access this object because a different thread owns it.". This exception appears within theApplyDefaultWindowBorder
method of theClientBorder
control. This appears to be isolated to Windows 10 only, because of the operating version check before hand.There is no guarantee the the ThemeChanged event was raised on the thread, so I only can think that we should be doing a thread safety check and ensuring that we are on the UI thread before updating the UI.
To Reproduce
Expected behavior
It should be possible to switch theme from a different thread, ensuring that there were thread safety checks done at the place of applying the UI changes.
Screenshots
OS version
Windows 10 21H2
.NET version
.net 8.0
WPF-UI NuGet version
3.0.4
Additional context
No response
The text was updated successfully, but these errors were encountered: