Changing the theme has no effect on some controls (only in release)
See original GitHub issueDescription
When I try to switch themes, the style of the button doesn’t seem to change shell is work normal
` public static void ChangeTheme(string mode) { ICollection<ResourceDictionary> mergedDictionaries = Application.Current.Resources.MergedDictionaries; mergedDictionaries.Clear(); if (mode == “朱”) { mergedDictionaries.Add(new ScarletTheme()); } else { mergedDictionaries.Add(new VioletTheme());
}
//mergedDictionaries.Add(keyValuePairs);
Preferences.Set("ColorMode", mode);
}
`
Steps to Reproduce
- Create Two Theme
- click button to changeTheme
Link to public reproduction project repository
https://github.com/ssccinng/PokeSci/tree/master/SVPokeDex
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android11
Did you find any workaround?
No response
Relevant log output
No response
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
I changed theme but cannot see new theme, it is still on old ...
Hi,. I have changed Theme from Twenty Nineteen to Public Blog theme. When I am in the admin mode, i can see on...
Read more >Dark theme not working · Issue #1746 · xournalpp ...
Hello, i just installed the latest release of Xournal++ (1.0.17) on my ... No, the dark theme only affects the color of the...
Read more >Trying to reload view controller to update the current theme
The way to use is really simple, to change all UILabel background color ... will toggle between this two (I only changed a...
Read more >10 Common WordPress Theme Issues & How To Fix Them
Common WordPress errors with solutions. We address some of the most common WordPress theme issues and provide easy solutions to fix them.
Read more >Respond to system theme changes - .NET MAUI
NET MAUI app can respond to operating system theme changes by using the AppThemeBinding markup extension, and the SetAppThemeColor and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @BretJohnson, Thanks for the informations. I upgraded to VS 17.6. I now have “7.0.86/7.0.100” with “dotnet workload list”.
Now, clearing the Application.Current.Resources.MergedDictionaries to set a new resourceDictionary works as expected : my new styles are applied. On the other hand, simply doing a Application.Current.Resources.MergedDictionaries.Clear() do not set the style back to original value.
Here’s my sample: in XAML:
<ButtonText=“Clear” Clicked=“Button_Clicked_1” />in code-behind: private void Button_Clicked_1( object sender, EventArgs e ) { Application.Current.Resources.MergedDictionaries.Clear(); }
private void Button_Clicked_2( object sender, EventArgs e ) { Application.Current.Resources.MergedDictionaries.Clear(); Application.Current.Resources.MergedDictionaries.Add( new Dictionary1() ); }
private void Button_Clicked_3( object sender, EventArgs e ) { Application.Current.Resources.MergedDictionaries.Clear(); Application.Current.Resources.MergedDictionaries.Add( new Dictionary2() ); }
ResourceDictionaries are attached to this conversation.
clicking to activate callback “Button_Clicked_1” do not reset Button Background to default value. ResourceDictionary.txt
@XceedBoucherS - MAUI 7.0.86 is included in Visual Studio 17.6, released yesterday. See https://devblogs.microsoft.com/visualstudio/visual-studio-2022-17-6-now-available/#comment-28752. If you upgrade to VS 17.6, you should have it. You can confirm by doing a
dotnet workload listand looking for7.0.86/7.0.100in the manifest versions.