esses
Topic Author
Posts: 9
Joined: 26 Sep 2016, 16:13

Re: Using EventTriggers gives error

03 Nov 2016, 16:29

What you have to make sure is that the xaml is correctly processed (without errors) after the InvokeCommand class is compiled and available in the assembly.
How can I make sure it is compiled and available? I don't get any error/warning to the NoesisGUIPanel component or the console. Rebuilding from Noesis Settings menu didn't help. Now I get this error in Blend:
latesterror.png
Latest error.
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: Using EventTriggers gives error

04 Nov 2016, 14:39

In Unity, we write messages to the Console window whenever we found warnings or errors processing the xamls. And if the xaml set in the NoesisGUIPanel contains errors, we also show in the component inspector a message to indicate it. You can see it here: http://www.noesisengine.com/docs/Gui.Co ... -noesisgui

The error in Blend maybe is because InvokeCommand class doesn't inherit from UIElement. Make sure of that, and maybe you don't have a public empty constructor for the class either:
namespace Assets.GloryAssets.Scripts.GUI.NoesisCommands
{
  public public class InvokeCommand : FrameworkElement
  {
    public InvokeCommand()
    {
    }
    ...
  }
}
 
esses
Topic Author
Posts: 9
Joined: 26 Sep 2016, 16:13

Re: Using EventTriggers gives error

07 Nov 2016, 13:12

Well, it is inherited from FrameWorkElement. After meddling around the issue disappeared, but it reappared after commenting
    <local:InvokeCommand x:Name="enterCommandInvoker"
        Command="{Binding EnterCommand}"
        CommandParameter="{Binding ElementName=rect}"/>
and uncommenting.

Simply creating a new scene and copy-pasting the example codes and putting them to NoesisGUIPanel (and trying rebuilding noesis + adding the public empty constructor) won't work. Red square is drawn, no warnings or errors in console nor in NoesisGUIPanel. InvokeCommandTestBehavior is attached to the NoesisGUIPanel object.

It seems I will have to do the UI differently. Thank you for the help.
 
Etana
Posts: 17
Joined: 21 Aug 2016, 13:14

Re: Using EventTriggers gives error

08 Nov 2016, 09:57

Hi Sfernandez,
First, thanks for helping me and Esses with our noesis issues.

After looking at your example with Esses and wondering why it works quite randomly we found out that keytime you placed in your example
<DiscreteBooleanKeyFrame KeyTime="0:0:0.01" Value="False"/> 
Was way too fast for unity/noesis to fire that invokeCommand, after changing time to
<DiscreteBooleanKeyFrame KeyTime="0:0:0.1" Value="False"/> 
Then mouseEnter occured everytime when ever mouse did enter that red rectancle.
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: Using EventTriggers gives error

10 Nov 2016, 19:51

I guess my machine was faster 8-)

Anyway, the trick here is just provide a change in the value to fire the trigger, so it is ok to use a bigger duration.
I'm glad it worked fine.
 
User avatar
jsantos
Site Admin
Posts: 2899
Joined: 20 Jan 2012, 17:18
Contact:

Re: Using EventTriggers gives error

11 Nov 2016, 21:54

Anyway, I am not sure if this behavior is correct. Even if you use a very small delta time, the command should be invoked.

We are investigating it.

Thanks!

Who is online

Users browsing this forum: No registered users and 1 guest