Page 1 of 1

Can storyboard be empty?

Posted: 10 Feb 2017, 10:07
by weilitao
Hi,

I need to build an empty storyboard as a timer(since it is inside a storyboard sequence). Here is my code (in Unity):

var storyboard = new Storyboard();
storyboard.Duration = new Duration(TimeSpan.FromMilliseconds(1000));
storyboard.Completed += (sender, e) {
// Never reach here
};
storyboard.Begin(this);

And in WPF, this works fine. But in Noesis, the Completed handler never run. So what's the right way to do this in Noesis?

Thanks very much.

Re: Can storyboard be empty?

Posted: 10 Feb 2017, 10:14
by ai_enabled
I don't know why the storyboard completed event doesn't triggered in that case. But you could try adding some doing nothing stuff into it (say, change Visibility from Visible at duration 0 to Visible at duration 1)...

Anyway... why do you need it? There are many more better ways to using timers in Unity. One of the easiest is to start Coroutine, yield a wait call for 1 second and then invoke the code you placed at Completed handler.

Regards!

Re: Can storyboard be empty?

Posted: 10 Feb 2017, 10:37
by sfernandez
@weilitao: Could you please report this in our bugtracker, this is clearly a bug, it should behave exactly the same as in WPF.

@ai_enabled: Thanks for the Coroutine tip ;)

Re: Can storyboard be empty?

Posted: 10 Feb 2017, 10:53
by weilitao
@sfernandez

I have submitted to the bug tracker.

@ai_enabled

Thanks for you help. you method just works fine. for my case. I just need to build an animation sequence. Then user can pause/resume the whole animation. so using an empty animation instead of timer may make code simpler.

Re: Can storyboard be empty?

Posted: 15 Feb 2017, 19:35
by sfernandez
Thanks for the report, we will solve it for a future release.