Elad8a
Topic Author
Posts: 11
Joined: 17 Jun 2018, 20:52

EmbeddedXamlProvider requires Application instance in new Noesis versions

06 May 2019, 15:15

Hi,

In our app we use the EmbeddedXamlProvider that loads a bunch of xamls embedded as binaries in a managed dll.
Trying to port the following code to use the latest Noesis dlls fails.
It seems that EmbeddedXamlProvider must now receive an application instance.
            EmbeddedXaml[] xamls = new EmbeddedXaml[]
            {
                new EmbeddedXaml { filename = "HUDPanel.xaml", resource = "HUDPanel" },
                new EmbeddedXaml { filename = "LeftToolbarOverlay.xaml", resource = "LeftToolbarOverlay" },
                new EmbeddedXaml { filename = "TopToolbarOverlay.xaml", resource = "TopToolbarOverlay" }
            };

            var xamlProvider = new EmbeddedXamlProvider(xamls, rm);
            GUI.SetXamlProvider(xamlProvider);
The reason we use this method is because we wish to render the Xaml elements to a texture (offscreen rendering).

Questions:
1. Is there an alternative way to load embedded xamls? I do not wish to ship the raw xaml files with our binaries.
2. can I somehow create a dummy app that will have the embedded xamls and still allow me to do offscreen rendering (with low overhead)?

Thanks,
Elad (BeyeOnics)
 
User avatar
sfernandez
Site Admin
Posts: 2991
Joined: 22 Dec 2011, 19:20

Re: EmbeddedXamlProvider requires Application instance in new Noesis versions

07 May 2019, 10:43

Hi,

Are you using our application framework (Noesis.App NuGet package)? In that case you should already have an Application created, so everything should work automatically if your resources (xamls, fonts, textures...) have their 'Build Action' set to 'Embedded Resource'. You no longer need to manually specify the resources using an EmbeddedXaml array.

In case you are integrating Noesis into your own engine, you can get the EmebeddedXamlProvider from our GitHub and adapt it to your needs, instead of passing an Application to its constructor you can, for example, directly pass the Assembly and namespace you are using. In fact this is something we can probably do ourselves for a future release to make those classes a bit more flexible.

Hope this helps.
 
Elad8a
Topic Author
Posts: 11
Joined: 17 Jun 2018, 20:52

Re: EmbeddedXamlProvider requires Application instance in new Noesis versions

08 May 2019, 16:39

Thanks, I followed your second suggestion. we are indeed integrating Noesis into or own Engine.

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot] and 12 guests