Issue
I am having a code which handles multiple animations. I want to wait until or know if multiple animations are completed. I am currently using await Task.Delay(1000);
and setting it equal to maximum duration of one of the animations.
Here is my C# Code Behind:
new Animation()
{
{ 0, 1, new Animation(a => dialogControl.FadeTo(1, 1000)) },
{ 0, 1, new Animation(a => dialogControl.ScaleTo(1, 1000)) },
}.Commit(this, "Animation1");
await Task.Delay(1000);
Debug.WriteLine("Do some task after multiple animations are completed");
Is there anyway it would wait until all animations are completed and only proceed then?
Solution
await Task.WhenAll(
dialogControl.FadeTo(1, 1000),
dialogControl.ScaleTo(1, 1000)
);
Debug.WriteLine("Do some task after multiple animations are completed");
Answered By - xleon
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.