Loading a Resource Dictionary programmatically.
I'm trying to load a resource dictionary from code. I've tried using GUI.LoadXaml(path) and GUI.LoadXamlResource(path) but I can't even getto pass a path that finds the resource.
Do you guys have an example of this by any chance?
Do you guys have an example of this by any chance?
-
sfernandez
Site Admin
- Posts: 2983
- Joined:
Re: Loading a Resource Dictionary programmatically.
We use that in our Localization sample:
But make sure that the xaml dictionary is referenced from any other loaded asset. You can do that by explicitly adding a dependency in one of your root xamls:
Code: Select all
Resources = (ResourceDictionary)Noesis.GUI.LoadXaml("Assets/NoesisGUI/Samples/Localization/Language-en.xaml")
Code: Select all
<noesis:Xaml.Dependencies>
<noesis:Dependency Source="Language-en.xaml"/>
</noesis:Xaml.Dependencies>
Who is online
Users browsing this forum: Google [Bot] and 12 guests