Browse Source

More cleanup.

Dariusz Komosinski 4 years ago
parent
commit
60ad7eae12
2 changed files with 14 additions and 15 deletions
  1. 2 3
      src/Avalonia.Animation/Clock.cs
  2. 12 12
      src/Avalonia.Animation/TransitionObservableBase.cs

+ 2 - 3
src/Avalonia.Animation/Clock.cs

@@ -10,10 +10,9 @@ namespace Avalonia.Animation
     {
         public static IClock GlobalClock => AvaloniaLocator.Current.GetService<IGlobalClock>();
 
-        private IDisposable _parentSubscription;
+        private readonly IDisposable _parentSubscription;
 
-        public Clock()
-            :this(GlobalClock)
+        public Clock() : this(GlobalClock)
         {
         }
         

+ 12 - 12
src/Avalonia.Animation/TransitionObservableBase.cs

@@ -15,18 +15,6 @@ namespace Avalonia.Animation
             _progress = progress;
         }
 
-        protected override void Unsubscribed()
-        {
-            _progressSubscription?.Dispose();
-        }
-
-        protected override void Subscribed()
-        {
-            _progressSubscription = _progress.Subscribe(this);
-        }
-
-        protected abstract T ProduceValue(double progress);
-
         void IObserver<double>.OnCompleted()
         {
             PublishCompleted();
@@ -41,5 +29,17 @@ namespace Avalonia.Animation
         {
             PublishNext(ProduceValue(value));
         }
+
+        protected override void Unsubscribed()
+        {
+            _progressSubscription?.Dispose();
+        }
+
+        protected override void Subscribed()
+        {
+            _progressSubscription = _progress.Subscribe(this);
+        }
+
+        protected abstract T ProduceValue(double progress);
     }
 }