Hi @Arthur P ,
Thanks for reaching out.
This behavior is expected and is due to the distinction between app theming and platform (OS) theming in .NET MAUI.
When you set Application.Current.UserAppTheme, you are only changing how your MAUI app renders its own UI. This can be changed dynamically at runtime and affects only the app.
Application.Current.PlatformAppTheme, however, reflects the operating system’s current theme (Light or Dark). This value is read-only and is determined entirely by the OS. Changing UserAppTheme does not - and cannot - change the platform theme.
At the OS level:
- Android does not allow apps to programmatically switch the system-wide theme.
- Windows also does not allow applications to change the user’s system theme.
Because MAUI follows platform rules and user expectations, there is no supported way to dynamically change the platform/OS theme from a MAUI app. The only thing an app can do is either:
- Follow the system theme by setting
UserAppTheme = AppTheme.Unspecified, or - Override the app’s appearance independently by setting
UserAppThemetoLightorDark.
So to directly answer your question: you cannot dynamically switch the platform theme. PlatformAppTheme will only change when the user changes the OS theme itself.
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.