Jumar Macato
8 years ago
No known key found for this signature in database
GPG Key ID: B19884DAC3A5BF3F
4 changed files with
7 additions and
12 deletions
-
src/Avalonia.Animation/AnimationInstance`1.cs
-
src/Avalonia.Animation/Animator`1.cs
-
src/Avalonia.Animation/DisposeAnimationInstanceSubject.cs
-
src/Avalonia.Controls/ProgressBar.cs
|
|
|
@ -188,7 +188,7 @@ namespace Avalonia.Animation |
|
|
|
|
|
|
|
if (!_isLooping) |
|
|
|
{ |
|
|
|
if ((_currentIteration > _repeatCount) | (time > iterationEndpoint)) |
|
|
|
if ((_currentIteration > _repeatCount) || (time > iterationEndpoint)) |
|
|
|
DoComplete(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -41,7 +41,7 @@ namespace Avalonia.Animation |
|
|
|
if (!_isVerifiedAndConverted) |
|
|
|
VerifyConvertKeyFrames(); |
|
|
|
|
|
|
|
var subject = new DisposeAnimationInstanceObservable<T>(this, animation, control, onComplete); |
|
|
|
var subject = new DisposeAnimationInstanceSubject<T>(this, animation, control, onComplete); |
|
|
|
return match.Subscribe(subject); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -15,7 +15,7 @@ namespace Avalonia.Animation |
|
|
|
/// <summary>
|
|
|
|
/// Manages the lifetime of animation instances as determined by its selector state.
|
|
|
|
/// </summary>
|
|
|
|
internal class DisposeAnimationInstanceObservable<T> : IObserver<bool>, IDisposable |
|
|
|
internal class DisposeAnimationInstanceSubject<T> : IObserver<bool>, IDisposable |
|
|
|
{ |
|
|
|
private IDisposable _lastInstance; |
|
|
|
private bool _lastMatch; |
|
|
|
@ -24,7 +24,7 @@ namespace Avalonia.Animation |
|
|
|
private Animatable _control; |
|
|
|
private Action _onComplete; |
|
|
|
|
|
|
|
public DisposeAnimationInstanceObservable(Animator<T> animator, Animation animation, Animatable control, Action onComplete) |
|
|
|
public DisposeAnimationInstanceSubject(Animator<T> animator, Animation animation, Animatable control, Action onComplete) |
|
|
|
{ |
|
|
|
this._animator = animator; |
|
|
|
this._animation = animation; |
|
|
|
@ -37,8 +37,8 @@ namespace Avalonia.Controls |
|
|
|
PseudoClass<ProgressBar, Orientation>(OrientationProperty, o => o == Avalonia.Controls.Orientation.Horizontal, ":horizontal"); |
|
|
|
PseudoClass<ProgressBar>(IsIndeterminateProperty, ":indeterminate"); |
|
|
|
|
|
|
|
ValueProperty.Changed.AddClassHandler<ProgressBar>(x => x.ValueChanged); |
|
|
|
IsIndeterminateProperty.Changed.AddClassHandler<ProgressBar>(x => x.IsIndeterminateChanged); |
|
|
|
ValueProperty.Changed.AddClassHandler<ProgressBar>(x => x.UpdateIndicatorWhenPropChanged); |
|
|
|
IsIndeterminateProperty.Changed.AddClassHandler<ProgressBar>(x => x.UpdateIndicatorWhenPropChanged); |
|
|
|
} |
|
|
|
|
|
|
|
public bool IsIndeterminate |
|
|
|
@ -115,12 +115,7 @@ namespace Avalonia.Controls |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void ValueChanged(AvaloniaPropertyChangedEventArgs e) |
|
|
|
{ |
|
|
|
UpdateIndicator(Bounds.Size); |
|
|
|
} |
|
|
|
|
|
|
|
private void IsIndeterminateChanged(AvaloniaPropertyChangedEventArgs e) |
|
|
|
private void UpdateIndicatorWhenPropChanged(AvaloniaPropertyChangedEventArgs e) |
|
|
|
{ |
|
|
|
UpdateIndicator(Bounds.Size); |
|
|
|
} |
|
|
|
|