User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Noesis 3.1.x Resource Dictionary Syntax

31 Dec 2021, 20:39

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.
 
User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Re: Noesis 3.1.x Resource Dictionary Syntax

31 Dec 2021, 21:04

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?
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Noesis 3.1.x Resource Dictionary Syntax

03 Jan 2022, 11:13

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?
 
User avatar
stonstad
Topic Author
Posts: 241
Joined: 06 Jun 2016, 18:14
Location: Lesser Magellanic Cloud
Contact:

Re: Noesis 3.1.x Resource Dictionary Syntax

04 Jan 2022, 22:03

Works great! Thank you!
 
User avatar
sfernandez
Site Admin
Posts: 2983
Joined: 22 Dec 2011, 19:20

Re: Noesis 3.1.x Resource Dictionary Syntax

05 Jan 2022, 00:02

Good to hear, marking this as solved.

Who is online

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