Page 1 of 3

Error when using NoesisExt in Blend

Posted: 01 Aug 2014, 18:56
by Cleroth
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"/>

Re: Error when using NoesisExt in Blend

Posted: 03 Aug 2014, 23:13
by jsantos
Are you including the proper extensions in your Blend project? (https://github.com/Noesis/noesisgui-con ... nd/Text.cs)

Re: Error when using NoesisExt in Blend

Posted: 07 Aug 2014, 22:11
by Cleroth
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.

Re: Error when using NoesisExt in Blend

Posted: 08 Aug 2014, 20:15
by sfernandez
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)));
        // ...
    }
}

Re: Error when using NoesisExt in Blend

Posted: 15 Aug 2014, 04:46
by Cleroth
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).

Re: Error when using NoesisExt in Blend

Posted: 16 Aug 2014, 11:50
by sfernandez
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.

Re: Error when using NoesisExt in Blend

Posted: 17 Aug 2014, 00:40
by Cleroth
But doesn't NoesisGUI have to find this file if you use the extension? How does it do this?

Re: Error when using NoesisExt in Blend

Posted: 17 Aug 2014, 03:13
by wckdspn
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.

Re: Error when using NoesisExt in Blend

Posted: 18 Aug 2014, 11:46
by jsantos
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.

Re: Error when using NoesisExt in Blend

Posted: 19 Aug 2014, 03:50
by Cleroth
Yes, I see, thanks.
Also, how come gradients have different colours when in Blend than when in Unity?