ToxaDev
Topic Author
Posts: 2
Joined: 15 Dec 2019, 20:25

UE4 loading XAML resources from DLL

25 Dec 2019, 22:32

Hi,
I try to use several resource libraries
<ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
        </ResourceDictionary.MergedDictionaries>
But as I already understood, there is no implementation of loading XAML resources from a DLL
UE_LOG - LogNoesis: Warning ... Xaml not found 'Themes/MaterialDesignTheme.Light.xaml
Can you advise please, how to make a XAML resource provider for this task in UE4?

Tags:
 
User avatar
hcpizzi
Site Admin
Posts: 229
Joined: 09 Feb 2012, 12:40

Re: UE4 loading XAML resources from DLL

30 Dec 2019, 13:08

Hi ToxaDev,

The UE4 plugin has built in Providers that work along Unreal's asset system. In order to use any XAMLs, you must first import them from the Unreal Editor. You can take a look at our Menu3D sample. It uses several UserControl XAMLs. You can see the imported XAML assets on the first screenshot on the readme.
 
ToxaDev
Topic Author
Posts: 2
Joined: 15 Dec 2019, 20:25

Re: UE4 loading XAML resources from DLL

30 Dec 2019, 16:55

Hi hcpizzi
Thanks for the answer, but I still have an question.

In my first post, I show this action:
<ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
</ResourceDictionary.MergedDictionaries>
This file "MaterialDesignTheme.Defaults.xaml" also has such actions for loading other resources:
<ResourceDictionary.MergedDictionaries>
		<ResourceDictionary
			Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/Materialdesigntheme.Button.xaml" />
		<ResourceDictionary
			Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Calendar.xaml" />
		<ResourceDictionary
			Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/Materialdesigntheme.CheckBox.xaml" />
...
There is some kind of nesting.
noesisGUI v2.2.5 by default cannot load resources as WPF does

Is it possible to somehow modify the code so that we can load resources through "pack://application:,,," and check the nesting too?
Can this be implemented using a custom XAML resource provider?
Are you planning to implement this in the near future?

Thanks!
 
User avatar
hcpizzi
Site Admin
Posts: 229
Joined: 09 Feb 2012, 12:40

Re: UE4 loading XAML resources from DLL

03 Jan 2020, 15:10

Hi,

Here's a link to the documentation related to how Noesis handles resource URIs: https://noesisengine.com/docs/Gui.Core.URIs.html

Basically, all the "pack://application,,," part is discarded, and the provider only gets "Themes/MaterialDesignTheme.Defaults.xaml". The UE4 plugin then looks for an Unreal asset with that same path. You could implement your own Provider and load files from disk directly, but then you would have to make sure those files are added to the final package of the game. In any case, you wouldn't get the assembly part of the URI.

There have been requests to change this. You can find some info in this forum thread: viewtopic.php?f=3&t=1830, and the associated ticket: #1569

Who is online

Users browsing this forum: No registered users and 8 guests