Topic Author
Posts: 2
Joined: 17 Sep 2020, 14:11

Loading a Resource Dictionary programmatically.

27 Jan 2021, 22:09

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?

User avatar
Site Admin
Posts: 2254
Joined: 22 Dec 2011, 19:20

Re: Loading a Resource Dictionary programmatically.

01 Feb 2021, 17:43

We use that in our Localization sample:
Resources = (ResourceDictionary)Noesis.GUI.LoadXaml("Assets/NoesisGUI/Samples/Localization/Language-en.xaml")
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:
  <noesis:Dependency Source="Language-en.xaml"/>

Who is online

Users browsing this forum: yuyoyuppe and 1 guest