Browse Source

Check if sender is equal to the argument. Cancel if it doesn't match.

pull/1795/head
Jumar Macato 8 years ago
parent
commit
728d5ae588
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 12
      src/Avalonia.Animation/Animation.cs

12
src/Avalonia.Animation/Animation.cs

@ -167,12 +167,18 @@ namespace Avalonia.Animation
var tcs = new TaskCompletionSource<object>();
if (this.RepeatCount == RepeatCount.Loop)
{
tcs.SetException(new InvalidOperationException("Looping animations must not use the Run method."));
return tcs.Task;
}
this.Done += delegate
this.Done += (sender, args) =>
{
tcs.SetResult(null);
}
if (sender == control)
tcs.SetResult(null);
else
tcs.SetCanceled();
};
this.Apply(control, Observable.Return(true));

Loading…
Cancel
Save