Browse Source
Check if sender is equal to the argument. Cancel if it doesn't match.
pull/1795/head
Jumar Macato
8 years ago
No known key found for this signature in database
GPG Key ID: B19884DAC3A5BF3F
1 changed files with
9 additions and
3 deletions
-
src/Avalonia.Animation/Animation.cs
|
|
@ -167,12 +167,18 @@ namespace Avalonia.Animation |
|
|
var tcs = new TaskCompletionSource<object>(); |
|
|
var tcs = new TaskCompletionSource<object>(); |
|
|
|
|
|
|
|
|
if (this.RepeatCount == RepeatCount.Loop) |
|
|
if (this.RepeatCount == RepeatCount.Loop) |
|
|
|
|
|
{ |
|
|
tcs.SetException(new InvalidOperationException("Looping animations must not use the Run method.")); |
|
|
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)); |
|
|
this.Apply(control, Observable.Return(true)); |
|
|
|
|
|
|
|
|
|