Open NickeManarin opened 5 years ago
Thanks for the sample!. I have been doing some tests and I can reproduce the problem. The situation is having two ResourceDictionaries at the same time and just change the order. Doing this only affects to pages opened afterwards.
Meanwhile, you can have this working with small changes. Add only the default theme (for example, the Light one) in the resources of App.
When you want to change the theme, delete the added Resource and add the new one.
Any news in a fix for this bug?
@jsuarezruiz This would be way harder for me to control my app, there's several styles and localizations, with fallback for generic ones (pt_BR -> pt).
Description
My app supports Light and Dark themes. I implemented the option to change the theme by having two resource dictionaries in separated files, like so:
When the user changes the theme to Light, I simply move the Light
ResourceDictionary
to the last position.The problem is that this only works for pages opened afterwards. It does not update the
DynamicResources
from pages already opened.Steps to Reproduce
DynamicResource
set.Expected Behavior
DynamicResource should be updated when the resource dictionary changes. Even for pages already open and loaded, like what happens with WPF.
Actual Behavior
DynamicResources are not updated, they act like StaticResources.
Basic Information
Reproduction Link
https://github.com/NickeManarin/Xamarin.Demos
(I'm using the same project to showcase bugs for other projects too, so ignore the first two buttons)
Edit:
It also happens in iOS, latest version. But I don't remember if the demo project is set up to run the iOS version of the app or not.