WinUI3 Trying to change theme to dark throws exception Exception thrown: 'System.NotSupportedException' in WinRT.Runtime.dll An exception of type 'System.NotSupportedException' occurred in WinRT.Runtime.dll but was not handled in user code Specified method is not supported. #12278
Replies: 2 comments 2 replies
-
OK so not an UNO issue, its an issue with WinUI3, see https://stackoverflow.com/questions/34554871/changing-theme-in-windows-10-uwp-app-programmatically Question to the Uno gang. Do you have a solution for this that is cross platform? While i can implement this on WinUI3 i get all sorts of issues with iOS and Net7.0 thanks
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Thanks for the help guys |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Current behavior
Using the standard Visual studio template i inserted this line in the App.cs startup after
Host = await builder.NavigateAsync();
App.Current.RequestedTheme = ApplicationTheme.Dark;
Throws the exception
Exception thrown: 'System.NotSupportedException' in WinRT.Runtime.dll
An exception of type 'System.NotSupportedException' occurred in WinRT.Runtime.dll but was not handled in user code
Specified method is not supported.
Simple example located at https://github.com/cconner100/ChangeThemeToDark
In general it seems like anything i try to do in WinUI3 now throws exceptions
Here is my environment. I rebuilt my windows box, reinstalled VS2022 and Uno check.
Expected behavior
Should not throw exception and should change the theme to dark mode
Beta Was this translation helpful? Give feedback.
All reactions