Can storyboard be empty?
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.
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.
- ai_enabled
- Posts: 231
- Joined:
- Contact:
Re: Can storyboard be empty?
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!
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
-
sfernandez
Site Admin
- Posts: 2995
- Joined:
Re: Can storyboard be empty?
@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
@ai_enabled: Thanks for the Coroutine tip
Re: Can storyboard be empty?
@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.
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.
-
sfernandez
Site Admin
- Posts: 2995
- Joined:
Re: Can storyboard be empty?
Thanks for the report, we will solve it for a future release.
Who is online
Users browsing this forum: No registered users and 4 guests