diff --git a/src/Avalonia.Animation/Animation.cs b/src/Avalonia.Animation/Animation.cs index 67b937e8ba..98fb652c4a 100644 --- a/src/Avalonia.Animation/Animation.cs +++ b/src/Avalonia.Animation/Animation.cs @@ -169,12 +169,18 @@ namespace Avalonia.Animation if (this.RepeatCount == RepeatCount.Loop) run.SetException(new InvalidOperationException("Looping animations must not use the Run method.")); - this.Done += (sender, args) => + EventHandler doneCallback = null; + doneCallback = (sender, args) => { if (sender == control) + { run.SetResult(null); + this.Done -= doneCallback; + } }; + this.Done += doneCallback; + this.Apply(control, Observable.Return(true)); return run.Task;