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
{{ message }}
Repository navigation
Load a theme at runtime - Codeblock throws exception #3468
By following this codeblock, this will result into an exception (Android.Runtime.JavaProxyThrowable).
The codeblock shows you only the remove ALL merged dictionaries, which means also the dictionaries MAUI needs and than add your own.
This means that you need to copy all the contents of Styles.xaml and Colors.xaml and put that into your own ResourceDictionary.
MAUI has two ResourceDictionaries and when those are removed the app just crashes.
A better approach would be to use .Remove(MyTheme) instead of .Clear().
@funnelshift I opened #3470 with a proposed fix that removes only the active theme dictionary instead of clearing all merged dictionaries. Could you confirm whether this is sufficient for the scenario you reported?
Activity
jfversluis commentedon Aug 13, 2026
@funnelshift I opened #3470 with a proposed fix that removes only the active theme dictionary instead of clearing all merged dictionaries. Could you confirm whether this is sufficient for the scenario you reported?
funnelshift commentedon Aug 13, 2026
@jfversluis I looked through it and looks good to me. I'll close this one up.