From e4fff20551f80f06e3bdd82861d272814667c445 Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sat, 15 Sep 2018 11:56:57 +0800 Subject: [PATCH] Address PR Reviews --- src/Avalonia.Animation/AnimationInstance`1.cs | 2 +- src/Avalonia.Animation/Animator`1.cs | 2 +- ...servable.cs => DisposeAnimationInstanceSubject.cs} | 4 ++-- src/Avalonia.Controls/ProgressBar.cs | 11 +++-------- 4 files changed, 7 insertions(+), 12 deletions(-) rename src/Avalonia.Animation/{DisposeAnimationInstanceObservable.cs => DisposeAnimationInstanceSubject.cs} (87%) diff --git a/src/Avalonia.Animation/AnimationInstance`1.cs b/src/Avalonia.Animation/AnimationInstance`1.cs index c264663b56..1480fbe741 100644 --- a/src/Avalonia.Animation/AnimationInstance`1.cs +++ b/src/Avalonia.Animation/AnimationInstance`1.cs @@ -188,7 +188,7 @@ namespace Avalonia.Animation if (!_isLooping) { - if ((_currentIteration > _repeatCount) | (time > iterationEndpoint)) + if ((_currentIteration > _repeatCount) || (time > iterationEndpoint)) DoComplete(); } diff --git a/src/Avalonia.Animation/Animator`1.cs b/src/Avalonia.Animation/Animator`1.cs index 0de3991a88..bdf655b5cb 100644 --- a/src/Avalonia.Animation/Animator`1.cs +++ b/src/Avalonia.Animation/Animator`1.cs @@ -41,7 +41,7 @@ namespace Avalonia.Animation if (!_isVerifiedAndConverted) VerifyConvertKeyFrames(); - var subject = new DisposeAnimationInstanceObservable(this, animation, control, onComplete); + var subject = new DisposeAnimationInstanceSubject(this, animation, control, onComplete); return match.Subscribe(subject); } diff --git a/src/Avalonia.Animation/DisposeAnimationInstanceObservable.cs b/src/Avalonia.Animation/DisposeAnimationInstanceSubject.cs similarity index 87% rename from src/Avalonia.Animation/DisposeAnimationInstanceObservable.cs rename to src/Avalonia.Animation/DisposeAnimationInstanceSubject.cs index f58e816e54..1ac2ac8b98 100644 --- a/src/Avalonia.Animation/DisposeAnimationInstanceObservable.cs +++ b/src/Avalonia.Animation/DisposeAnimationInstanceSubject.cs @@ -15,7 +15,7 @@ namespace Avalonia.Animation /// /// Manages the lifetime of animation instances as determined by its selector state. /// - internal class DisposeAnimationInstanceObservable : IObserver, IDisposable + internal class DisposeAnimationInstanceSubject : IObserver, IDisposable { private IDisposable _lastInstance; private bool _lastMatch; @@ -24,7 +24,7 @@ namespace Avalonia.Animation private Animatable _control; private Action _onComplete; - public DisposeAnimationInstanceObservable(Animator animator, Animation animation, Animatable control, Action onComplete) + public DisposeAnimationInstanceSubject(Animator animator, Animation animation, Animatable control, Action onComplete) { this._animator = animator; this._animation = animation; diff --git a/src/Avalonia.Controls/ProgressBar.cs b/src/Avalonia.Controls/ProgressBar.cs index fe7b8e64c7..a0f51099cd 100644 --- a/src/Avalonia.Controls/ProgressBar.cs +++ b/src/Avalonia.Controls/ProgressBar.cs @@ -37,8 +37,8 @@ namespace Avalonia.Controls PseudoClass(OrientationProperty, o => o == Avalonia.Controls.Orientation.Horizontal, ":horizontal"); PseudoClass(IsIndeterminateProperty, ":indeterminate"); - ValueProperty.Changed.AddClassHandler(x => x.ValueChanged); - IsIndeterminateProperty.Changed.AddClassHandler(x => x.IsIndeterminateChanged); + ValueProperty.Changed.AddClassHandler(x => x.UpdateIndicatorWhenPropChanged); + IsIndeterminateProperty.Changed.AddClassHandler(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); }