Cleroth
Topic Author
Posts: 13
Joined: 12 May 2014, 16:41

Error when using NoesisExt in Blend

01 Aug 2014, 18:56

I'm getting the following error when using NoesisExt in Blend:
The name "Text" does not exist in the namespace "clr-namespace:NoesisGUIExtensions".
at lines:
			<Setter Property="noesisExt:Text.Stroke" Value="Black"/>
			<Setter Property="noesisExt:Text.StrokeThickness" Value="1"/>
 
User avatar
jsantos
Site Admin
Posts: 3919
Joined: 20 Jan 2012, 17:18
Contact:

Re: Error when using NoesisExt in Blend

03 Aug 2014, 23:13

Are you including the proper extensions in your Blend project? (https://github.com/Noesis/noesisgui-con ... nd/Text.cs)
 
Cleroth
Topic Author
Posts: 13
Joined: 12 May 2014, 16:41

Re: Error when using NoesisExt in Blend

07 Aug 2014, 22:11

Hmm, I found the answer here: viewtopic.php?f=3&t=301&p=1477&hilit=extensions#p1477

However, I'm getting the same error related to ColorPicker at this line:
<noesis:ColorPicker x:Name="ColorPicker"/>
There is no ColorPicker in the repo you mentioned, and using the one in Assets\NoesisGUI\UserControls\ColorPicker\ColorPicker.cs just throws a bunch of compiler errors ( The type or namespace name 'UnityEngine' could not be found, etc...)

Also, I'm using Unity's version, if that's of any use.
 
User avatar
sfernandez
Site Admin
Posts: 2995
Joined: 22 Dec 2011, 19:20

Re: Error when using NoesisExt in Blend

08 Aug 2014, 20:15

Hi,

The .cs files included in the NoesisGUI package are scripts valid only for Unity. They use our C# API that it is not 100% compatible with WPF, so they won't work directly in Blend.

Maybe this is something we can improve for a next release and provide Blend projects for all the samples of the NoesisGUI package.

If you want to open ColorPicker.xaml in Blend you will have to create a ColorPicker.xaml.cs file like this:
using System;
using System.Windows;
using System.Windows.Controls;

namespace Noesis.UserControls
{
    public partial class ColorPicker : UserControl
    {
        public ColorPicker
        {
            InitializeComponent();
        }

        // Color dependency property definition
        public static DependencyProperty ColorProperty = DependencyProperty.Register("Color",
            typeof(Noesis.SolidColorBrush), typeof(ColorPicker),
            new PropertyMetadata(null, new PropertyChangedCallback(OnColorChanged)));
        // ...
    }
}
 
Cleroth
Topic Author
Posts: 13
Joined: 12 May 2014, 16:41

Re: Error when using NoesisExt in Blend

15 Aug 2014, 04:46

I'm having a similar problem with Text.cs but on Unity this time. There is a preprocessor guard on it (#if !UNITY_EDITOR) so that it doesn't get compiled in the Editor. Unfortunately when I build the game, it will come up with errors when trying compile that .cs
Changing it to #if !(UNITY_EDITOR || UNITY_STANDALONE) fixes it (but not for other platforms), but I think it really should be a whitelist rather than a blacklist (ie. it should be #if NOESIS_GUI if such a thing exists).
 
User avatar
sfernandez
Site Admin
Posts: 2995
Joined: 22 Dec 2011, 19:20

Re: Error when using NoesisExt in Blend

16 Aug 2014, 11:50

I think it really should be a whitelist rather than a blacklist (ie. it should be #if NOESIS_GUI if such a thing exists).
This will be great, the problem is we cannot define this kind of values. Is Unity who compiles and provides the pre-processing directives.

But, if anyone knows how to do it, we are glad to hear ;)

What we usually do with Text.cs is don't include it in the Assets folder, so Unity ignores it. You can "Link to Existing Item..." in Blend to a Text.cs file placed elsewhere.
 
Cleroth
Topic Author
Posts: 13
Joined: 12 May 2014, 16:41

Re: Error when using NoesisExt in Blend

17 Aug 2014, 00:40

But doesn't NoesisGUI have to find this file if you use the extension? How does it do this?
 
wckdspn
Posts: 67
Joined: 18 Aug 2012, 23:14

Re: Error when using NoesisExt in Blend

17 Aug 2014, 03:13

Noesis defines the extension internally. The BlendExt library is to implement the additional properties so that the compiler doesn't complain about missing references. As such, it shouldn't be built by Unity, but only by the Blend project.
 
User avatar
jsantos
Site Admin
Posts: 3919
Joined: 20 Jan 2012, 17:18
Contact:

Re: Error when using NoesisExt in Blend

18 Aug 2014, 11:46

That it is. For example
<TextBlock noesis:Text.Stroke="Red" noesis:Text.StrokeThickness="1" Text="Hello"/>
Here, Text.Stroke is an attached dependency property that does not exist in WPF. Our parser understands it perfectly but Blend does know nothing about it. We use Text.cs fot that purpose, to create a fake property that allows Blend parsing correctly this XAML.
 
Cleroth
Topic Author
Posts: 13
Joined: 12 May 2014, 16:41

Re: Error when using NoesisExt in Blend

19 Aug 2014, 03:50

Yes, I see, thanks.
Also, how come gradients have different colours when in Blend than when in Unity?

Who is online

Users browsing this forum: Bing [Bot] and 9 guests