AliciaCastillo
Topic Author
Posts: 16
Joined: 16 Apr 2024, 10:17

Inherit Noesis Theme or Styles merged into my custom Styles

11 Jun 2024, 10:49

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

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

11 Jun 2024, 20:50

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?
 
AliciaCastillo
Topic Author
Posts: 16
Joined: 16 Apr 2024, 10:17

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

12 Jun 2024, 09:10

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 :)

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest