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: 2984
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: 2984
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: 3906
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!
 
MarcusM-PDX
Posts: 4
Joined: 31 May 2023, 10:24

Re: Using EventTriggers gives error

25 Jul 2023, 15:17

A bit of a necro here, but for anyone that sees this, one useful thing you can do which appears to work for me is that instead of the following:
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="enterCommandInvoker"
				Storyboard.TargetProperty="Invoke">
	<DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
	<DiscreteBooleanKeyFrame KeyTime="0:0:0.01" Value="False"/>
</BooleanAnimationUsingKeyFrames>
You can set the FillBehavior on the BooleanAnimationUsingKeyFrames to "Stop" and do without the False value. Like so:
<BooleanAnimationUsingKeyFrames Storyboard.TargetName="enterCommandInvoker"
				Storyboard.TargetProperty="Invoke"
				FillBehaviour="Stop">
	<DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
</BooleanAnimationUsingKeyFrames>
I believe this now makes the resetting of the behavior immune to the framerate issues that were discussed before.
 
User avatar
sfernandez
Site Admin
Posts: 2984
Joined: 22 Dec 2011, 19:20

Re: Using EventTriggers gives error

31 Jul 2023, 14:01

Thanks a lot for sharing, this makes more sense as the animated value is removed as soon as the animation finishes, automatically restoring the oringinal false value.
 
MarcusM-PDX
Posts: 4
Joined: 31 May 2023, 10:24

Re: Using EventTriggers gives error

01 Aug 2023, 11:16

No problem, happy to help! The CommandInvoker solved a lot of problems for me, so I was happy to give back! :D

Who is online

Users browsing this forum: No registered users and 55 guests