diff --git a/src/IconPacks.Avalonia.Core/IconPacks.Avalonia.Core.csproj b/src/IconPacks.Avalonia.Core/IconPacks.Avalonia.Core.csproj
index 8e8825a..214e64a 100644
--- a/src/IconPacks.Avalonia.Core/IconPacks.Avalonia.Core.csproj
+++ b/src/IconPacks.Avalonia.Core/IconPacks.Avalonia.Core.csproj
@@ -20,7 +20,6 @@
-
diff --git a/src/IconPacks.Avalonia.Core/PackIconControlBase.cs b/src/IconPacks.Avalonia.Core/PackIconControlBase.cs
index 80fa4b9..2285034 100644
--- a/src/IconPacks.Avalonia.Core/PackIconControlBase.cs
+++ b/src/IconPacks.Avalonia.Core/PackIconControlBase.cs
@@ -1,6 +1,4 @@
using System;
-using System.Reactive;
-using System.Reactive.Linq;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Animation;
@@ -43,22 +41,6 @@ public abstract class PackIconControlBase : PackIconBase
protected PackIconControlBase()
{
AffectsRender(SpinProperty, SpinDurationProperty, OpacityProperty, SpinEasingFunctionProperty, FlipProperty, RotationAngleProperty);
-
- Observable.CombineLatest(
- this.GetObservable(SpinProperty).Select(_ => Unit.Default),
- this.GetObservable(IsVisibleProperty).Select(_ => Unit.Default),
- this.GetObservable(SpinDurationProperty).Select(_ => Unit.Default),
- this.GetObservable(OpacityProperty).Select(_ => Unit.Default),
- this.GetObservable(SpinEasingFunctionProperty).Select(_ => Unit.Default))
- .Select(_ => this.CanSpin())
- .Subscribe(spin =>
- {
- this.StopSpinAnimation();
- if (spin)
- {
- this.BeginSpinAnimation();
- }
- });
}
private bool CanSpin()
@@ -121,6 +103,21 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
this.UpdateRotateTransformation(change.GetNewValue());
}
}
+
+ // Update Spin-Animation as needed
+ if (change.Property == SpinProperty
+ || change.Property == IsVisibleProperty
+ || change.Property == SpinDurationProperty
+ || change.Property == OpacityProperty
+ || change.Property == SpinEasingFunctionProperty)
+ {
+ this.StopSpinAnimation();
+
+ if (this.CanSpin())
+ {
+ this.BeginSpinAnimation();
+ }
+ }
}
private void UpdateScaleTransformation(PackIconFlipOrientation flipOrientation)