Page 1 of 1

Inherit Noesis Theme or Styles merged into my custom Styles

Posted: 11 Jun 2024, 10:49
by AliciaCastillo
Hi, I'm working in a project where I use VisualStudio 2022, Blend and Unity and i've got the NoesisGUI-Unity-3-2 package folder inside my project, at the same Assets folder level.

I'm trying to inherit Noesis Theme/Styles for some cases where I don't have a custom style defined yet. Fisrt of all, is this possible?
I have my own Styles.xaml (inside Assets/Templates) setted up in Noesis.Settings and I'm applying styles to my controls throw keys (Style={DymanicResource MyStyleKey}) and i've been trying to Merge into my ResourceDictionary the Noesis styles but it's giving me some url issues, is there a way to do so?

Re: Inherit Noesis Theme or Styles merged into my custom Styles

Posted: 11 Jun 2024, 20:50
by sfernandez
Hello,

In the Blend project you should add our Noesis.GUI.Extension nuget, that will provide all our extensions and access to the Theme styles.
Then you can modify your App.xaml to include the theme and your resources:
<Application ...>
  <Application.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Noesis.GUI.Extensions;component/Theme/NoesisTheme.DarkBlue.xaml" />
        <ResourceDictionary Source="/Assets/Templates/Styles.xaml" />
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Application.Resources>
</Application>
In Unity you should have a dictionary that references the theme asset included in our Unity plugin and set it in the Application Resources in Noesis settings:
<ResourceDictionary ...>
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/Packages/com.noesis.noesisgui/Theme/NoesisTheme.DarkBlue.xaml" />
    <ResourceDictionary Source="/Assets/Templates/Styles.xaml" />
  </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
With that setup you can override some styles and use them (with name keys or by type), and the rest will default to the Noesis theme.

Is that what you are looking for?

Re: Inherit Noesis Theme or Styles merged into my custom Styles

Posted: 12 Jun 2024, 09:10
by AliciaCastillo
Hello,

In the Blend project you should add our Noesis.GUI.Extension nuget, that will provide all our extensions and access to the Theme styles.
Then you can modify your App.xaml to include the theme and your resources:
<Application ...>
  <Application.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Noesis.GUI.Extensions;component/Theme/NoesisTheme.DarkBlue.xaml" />
        <ResourceDictionary Source="/Assets/Templates/Styles.xaml" />
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Application.Resources>
</Application>
In Unity you should have a dictionary that references the theme asset included in our Unity plugin and set it in the Application Resources in Noesis settings:
<ResourceDictionary ...>
  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/Packages/com.noesis.noesisgui/Theme/NoesisTheme.DarkBlue.xaml" />
    <ResourceDictionary Source="/Assets/Templates/Styles.xaml" />
  </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
With that setup you can override some styles and use them (with name keys or by type), and the rest will default to the Noesis theme.

Is that what you are looking for?
Hi!
Yeah thanks, that worked perfect :)