Page 1 of 1

Interaction Element not supported in Unity

Posted: 31 Jul 2019, 22:40
by nizesh
Hi,

I very new to Noesis GUI and I'm trying to apply the Interactivity Behaviour as shown in this page https://www.noesisengine.com/docs/2.2/A ... viors.html. It doesn't show any errors in XAML inside Visual Studio but when I run the code in Unity, it gives me this error
NoesisException: Assets/Spyglass/Dashboard/Dashboard.xaml(924): Unknown type 'Interaction'. Rethrow as NoesisException
Noesis.Error.Check () (at Assets/NoesisGUI/Plugins/API/Core/NoesisError.cs:17)
Noesis.GUI.Noesis_LoadXaml_ (System.String xaml) (at Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs:275)
Noesis.GUI.LoadXaml (System.String xaml) (at Assets/NoesisGUI/Plugins/API/Core/NoesisGUI.cs:125)
NoesisXaml.Load () (at Assets/NoesisGUI/Plugins/NoesisXaml.cs:31)
NoesisView.LoadXaml (System.Boolean force) (at Assets/NoesisGUI/Plugins/NoesisView.cs:333)
NoesisView.OnEnable () (at Assets/NoesisGUI/Plugins/NoesisView.cs:398)
My Dashboard.xaml
<UserControl x:Class="Dashboard.Dashboard"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    FontFamily="Resources/Fonts/#Roboto"
    Foreground="#FFC9CCCF"
    d:DesignWidth="1280" d:DesignHeight="720">
    ...
	<Grid>
               <Border Background="Silver" Margin="100">
                      <Rectangle Width="100" Height="50" Fill="Red">
                             <i:Interaction.Behaviors>
                                      <ei:TranslateZoomRotateBehavior SupportedGestures="Scale" />
                              </i:Interaction.Behaviors>
                       </Rectangle>
                 </Border>
         </Grid>
                                    ...
      <UserControl>                              
I'm not sure what's wrong. Can someone please help me?

Re: Interaction Element not supported in Unity

Posted: 01 Aug 2019, 17:44
by sfernandez
Hi and welcome,

In NoesisGUI Unity package we include our own implementation of interactivity behaviors and triggers, you can find them under Assets/NoesisGUI/Samples/Interactivity/ folder.

Did you import that folder in your project?

Re: Interaction Element not supported in Unity

Posted: 01 Aug 2019, 18:03
by nizesh
Hi @sfernandez Thanks for the prompt response. I don't see the Interactivity folder inside the Assets/NoesisGUI/Samples directory. All I have is shown in the image in the link https://ibb.co/D9Xyj90 I also don't see the Interactivity Folder at the github page https://github.com/Noesis/Tutorials/tree/master/Samples

Re: Interaction Element not supported in Unity

Posted: 01 Aug 2019, 18:12
by sfernandez
Looking at the attached image it seems you are using an old version of our Unity package.
Could you please download the latest version (2.2.3)?
Then import the package into your project, it must include the folder NoesisGUI/Samples/Interactivity/ next to the other sample folders.

Re: Interaction Element not supported in Unity

Posted: 01 Aug 2019, 18:14
by sfernandez
By the way... the latest version of all C# code is also available at GitHub: https://github.com/Noesis/Managed
And you can find Interactivity folder there too: https://github.com/Noesis/Managed/tree/ ... eractivity

Re: Interaction Element not supported in Unity

Posted: 01 Aug 2019, 20:33
by nizesh
That worked like a charm. Thank you so much. I really appreciate it. :D

I'm trying to generate an interactive flow graphs something like this https://ibb.co/JqyvCsy in Unity using Noesis framework. Right now I'm trying to build an entire graph engine from the ground zero. It would be very helpful if there's already something inside Noesis and Unity for this. Even if there is none, an experienced suggestion would be highly encouraging enough for me. Thanks in advance.

Re: Interaction Element not supported in Unity

Posted: 02 Aug 2019, 11:35
by sfernandez
I don't know how the layout of these shapes is decided but the simplest way of placing UI elements is using a Canvas container.
As you have two layers, one for arrows and other for the nodes, I will use one Canvas panel for each layer.

Apart from that, if you want to follow a MVVM pattern I guess you will have a ViewModel that exposes a collection for the arrow connections and a collection for the nodes. Those collections will be bound to 2 ItemControls which will use a Canvas as the ItemsPanel to correctly position all the data.

Hope that helps.

Re: Interaction Element not supported in Unity

Posted: 02 Aug 2019, 21:11
by nizesh
I'll try to implement them as you said. Thanks a lot for the help

Re: Interaction Element not supported in Unity

Posted: 20 Nov 2019, 10:34
by mikmueller
Hi and welcome,

In NoesisGUI Unity package we include our own implementation of interactivity behaviors and triggers, you can find them under Assets/NoesisGUI/Samples/Interactivity/ folder.

Did you import that folder in your project?
Since it is part of the framework, I don't get why it is located in the samples folder. I usually delete sample/example folders to not bloat my repo and it took me ages to find out it was there.
I would def. put that into the core folder.

Re: Interaction Element not supported in Unity

Posted: 20 Nov 2019, 11:44
by sfernandez
Application framework is not part of NoesisGUI unity package because application/window logic is provided by Unity itself.
And interactivity classes are not part of WPF nor NoesisGUI, are just extensions built on top of the core library to add interactivity behaviors and triggers. Some of our samples use them, so that is why we include them in the Samples folder.

We will study the possibility of moving Interactivity folder inside the Plugin folder.