Replies: 1 comment 4 replies
-
Similar question here: How do I start and stop an animation with And even if this seems to work most of the time, there seems to be no way to observe (at code runtime) if the animation is currently running. That would be helpful to decide whether to let it run or restart such a longer living animation. |
Beta Was this translation helpful? Give feedback.
-
As you can see, the
Animation.RunAsync
will set the excpetion to TaskCompletionSource when the IterationCount is InfiniteAvalonia/src/Avalonia.Base/Animation/Animation.cs
Lines 342 to 343 in 2d51602
I have other ideas, we can await the Animation.RunAsync when IterationCount is Infinite. And we can finish the RunAsync by cancellationToken be set.
By the ways, the other issues is when I receive the InvalidOperationException with
Looping animations must not use the Run method.
, that I do not know what should I do.Beta Was this translation helpful? Give feedback.
All reactions