weilitao
Topic Author
Posts: 22
Joined: 23 Feb 2016, 10:43

Can storyboard be empty?

10 Feb 2017, 10:07

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.
 
User avatar
ai_enabled
Posts: 221
Joined: 18 Jul 2013, 05:28
Contact:

Re: Can storyboard be empty?

10 Feb 2017, 10:14

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!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: Can storyboard be empty?

10 Feb 2017, 10:37

@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 ;)
 
weilitao
Topic Author
Posts: 22
Joined: 23 Feb 2016, 10:43

Re: Can storyboard be empty?

10 Feb 2017, 10:53

@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.
 
User avatar
sfernandez
Site Admin
Posts: 1911
Joined: 22 Dec 2011, 19:20

Re: Can storyboard be empty?

15 Feb 2017, 19:35

Thanks for the report, we will solve it for a future release.

Who is online

Users browsing this forum: No registered users and 2 guests