dazza
Topic Author
Posts: 14
Joined: 10 Jan 2022, 20:41

Using a sample theme in Blend: Undefined CLR Namespace

08 Mar 2022, 16:00

I have a Blend project that I can successfully build (no errors or warnings) and load the XAML in to my C++ application. All good.

I am attempting to add a sample theme (Noesis.Theme.LightRed.xaml). However I get:
XLS0419	Undefined CLR namespace. The 'clr-namespace' URI refers to a namespace 'NoesisGUIExtensions' that could not be found.	GA-blend	C:\blendui\Theme\NoesisTheme.Styles.xaml	5	
I have installed the Noesis.GUI.Extensions nuget but it's still not working. In NoesisTheme.Styles.xaml the line
 xmlns:local="clr-namespace:NoesisGUIExtensions">
has squiggles under it with the error that it can't be found.

Any idea how I can fix this.
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Using a sample theme in Blend: Undefined CLR Namespace

08 Mar 2022, 17:03

This is probably because you are including the theme xamls in your Blend project, instead of using the resources included in Noesis.GUI.Extensions package.
You can reference them in the App.xaml (after adding the nuget package) by specifying in the Uri also the assembly, like this:
<ResourceDictionary Source="pack://application:,,,/Noesis.GUI.Extensions;component/Theme/NoesisTheme.LightRed.xaml" />
Have you tried that?
 
dazza
Topic Author
Posts: 14
Joined: 10 Jan 2022, 20:41

Re: Using a sample theme in Blend: Undefined CLR Namespace

08 Mar 2022, 17:20

Thank you, yes, I did have them as part of the blend project so they were easier to edit. Removing them stops the errors.

Is this not possible then?
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Using a sample theme in Blend: Undefined CLR Namespace

08 Mar 2022, 18:38

If you want to edit a local copy of the theme files then you'll need to change the namespace prefix in NoesisTheme.Styles.xaml to point to the Noesis.GUI.Extensions assembly, so types and properties referenced in that xaml can be correctly resolved:
xmlns:local="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions"
 
dazza
Topic Author
Posts: 14
Joined: 10 Jan 2022, 20:41

Re: Using a sample theme in Blend: Undefined CLR Namespace

08 Mar 2022, 19:37

Ah thank you, yes that worked.
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: Using a sample theme in Blend: Undefined CLR Namespace

09 Mar 2022, 16:17

Great, marking this as solved.

Who is online

Users browsing this forum: Google [Bot] and 11 guests