Page 1 of 1

Noesis 3.1.x Resource Dictionary Syntax

Posted: 31 Dec 2021, 20:39
by stonstad
I'm seeing unstylized content (pink) throughout my UIs. In 3.0.x I maintained a resource dictionary with the following merged dictionaries:

Resources.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
    <ResourceDictionary.MergedDictionaries>

        <!-- Noesis 3.0.x -->
        <ResourceDictionary Source="/Assets/NoesisGUI/Theme/NoesisTheme.Brushes.DarkBlue.xaml" />
        <ResourceDictionary Source="/Assets/NoesisGUI/Theme/NoesisTheme.Fonts.xaml" />
        <ResourceDictionary Source="/Assets/NoesisGUI/Theme/NoesisTheme.Styles.xaml" />

        <ResourceDictionary Source="ResourcesImages.xaml"/>
        <ResourceDictionary Source="ResourcesCommon.xaml"/>
        <ResourceDictionary Source="ResourcesTheme.xaml"/>

    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
In 3.1.2, I'm referencing these XAML files via the pack URI syntax and it is not finding the integrated XAML. Any suggestions on what the correct approach might be?
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
    <ResourceDictionary.MergedDictionaries>

        <!-- Noesis 3.1.2 -->
        <ResourceDictionary Source="pack://application:,,,/Noesis.GUI.Extensions;component/Theme/NoesisTheme.DarkBlue.xaml" />
        <ResourceDictionary Source="pack://application:,,,/Noesis.GUI.Extensions;component/Theme/NoesisTheme.Styles.xaml" />

        <ResourceDictionary Source="ResourcesImages.xaml"/>
        <ResourceDictionary Source="ResourcesCommon.xaml"/>
        <ResourceDictionary Source="ResourcesTheme.xaml"/>

    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
Errors:
[NOESIS/E] Assets/User Interface/Resources.xaml(4): Xaml not found '/Noesis.GUI.Extensions;component/Theme/NoesisTheme.DarkBlue.xaml'
[NOESIS/E] Assets/User Interface/Resources.xaml(6): Xaml not found '/Noesis.GUI.Extensions;component/Theme/NoesisTheme.Styles.xaml'

My Noesis settings specify the above Resources.xaml file as the Application Resources file.

Re: Noesis 3.1.x Resource Dictionary Syntax

Posted: 31 Dec 2021, 21:04
by stonstad
As a temporary workaround, I am able to copy 3.1.2 themes to a folder within assets and reference them using a relative file path. The behavior seems to be related to the pack URI interface. Does it matter that my unmodified package source files (extracted from zip) exist outside of the Unity folder?

Re: Noesis 3.1.x Resource Dictionary Syntax

Posted: 03 Jan 2022, 11:13
by sfernandez
Hi,

To reference the theme xamls included in our package the path should look like this:
<ResourceDictionary Source="/Packages/com.noesis.noesisgui/Theme/NoesisTheme.DarkBlue.xaml"/>
Could you please try that?

Re: Noesis 3.1.x Resource Dictionary Syntax

Posted: 04 Jan 2022, 22:03
by stonstad
Works great! Thank you!

Re: Noesis 3.1.x Resource Dictionary Syntax

Posted: 05 Jan 2022, 00:02
by sfernandez
Good to hear, marking this as solved.