How to Update GUI after SetApplicationResources
Hi how do i update the whole Gui from noesis after i load a new resource Dictionary like this:
and set the Global Style with
which method i need to call after set, this to see the changes?
Code: Select all
newRes = (ResourceDictionary)GUI.LoadXaml("Assets/_Game/Gui/Menu/ResourceDictionary/Theme.DarkBlue.xaml");
Code: Select all
Noesis.GUI.SetApplicationResources(newRes);
-
-
sfernandez
Site Admin
- Posts: 2056
- Joined:
Re: How to Update GUI after SetApplicationResources
Hi, I verified that changes made to ApplicationResources or its dictionary are not notified to the tree. This is a deviation from WPF, could you please report it?
Anyway, I want to clarify that if your UI elements are using StaticResources then changes to the ApplicationResources won't be reflected until you reload the entire UI, because StaticResources are locally set in the controls. If you need your controls to be updated when ApplicationResources is modified, you have to use DynamicResources.
For example, our NoesisTheme uses DynamicResources for all the brushes and some other resources, so we are able to set a new dictionary (as part of the UI tree) with different color brushes to update the appearance of the UI. We do this in our Gallery application: https://github.com/Noesis/Tutorials/tre ... es/Gallery
Anyway, I want to clarify that if your UI elements are using StaticResources then changes to the ApplicationResources won't be reflected until you reload the entire UI, because StaticResources are locally set in the controls. If you need your controls to be updated when ApplicationResources is modified, you have to use DynamicResources.
For example, our NoesisTheme uses DynamicResources for all the brushes and some other resources, so we are able to set a new dictionary (as part of the UI tree) with different color brushes to update the appearance of the UI. We do this in our Gallery application: https://github.com/Noesis/Tutorials/tre ... es/Gallery
Who is online
Users browsing this forum: No registered users and 0 guests