From 946c69dbd2bb22dd5c7204bbf00d57e3b307a063 Mon Sep 17 00:00:00 2001 From: Julien Lebosquain Date: Wed, 4 Feb 2026 18:28:49 +0100 Subject: [PATCH] Remove CustomAnimatorBase --- .../Animation/Animation.AnimatorRegistry.cs | 13 +------- .../Animation/ICustomAnimator.cs | 30 +------------------ 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/src/Avalonia.Base/Animation/Animation.AnimatorRegistry.cs b/src/Avalonia.Base/Animation/Animation.AnimatorRegistry.cs index b07bd686b8..da3c4cb8e6 100644 --- a/src/Avalonia.Base/Animation/Animation.AnimatorRegistry.cs +++ b/src/Avalonia.Base/Animation/Animation.AnimatorRegistry.cs @@ -7,17 +7,6 @@ namespace Avalonia.Animation; partial class Animation { - /// - /// Sets the value of the Animator attached property for a setter. - /// - /// The animation setter. - /// The property animator value. - [Obsolete("CustomAnimatorBase will be removed before 11.0, use InterpolatingAnimator", true)] - public static void SetAnimator(IAnimationSetter setter, CustomAnimatorBase value) - { - s_animators[setter] = (value.WrapperType, value.CreateWrapper); - } - /// /// Sets the value of the Animator attached property for a setter. /// @@ -92,4 +81,4 @@ partial class Animation return null; } -} \ No newline at end of file +} diff --git a/src/Avalonia.Base/Animation/ICustomAnimator.cs b/src/Avalonia.Base/Animation/ICustomAnimator.cs index 119a6115da..7155af1223 100644 --- a/src/Avalonia.Base/Animation/ICustomAnimator.cs +++ b/src/Avalonia.Base/Animation/ICustomAnimator.cs @@ -2,34 +2,6 @@ using System; using Avalonia.Animation.Animators; namespace Avalonia.Animation; -[Obsolete("This class will be removed before 11.0, use InterpolatingAnimator", true)] -public abstract class CustomAnimatorBase -{ - internal abstract IAnimator CreateWrapper(); - internal abstract Type WrapperType { get; } -} - -[Obsolete("This class will be removed before 11.0, use InterpolatingAnimator", true)] -public abstract class CustomAnimatorBase : CustomAnimatorBase -{ - public abstract T Interpolate(double progress, T oldValue, T newValue); - - internal override Type WrapperType => typeof(AnimatorWrapper); - internal override IAnimator CreateWrapper() => new AnimatorWrapper(this); - - internal class AnimatorWrapper : Animator - { - private readonly CustomAnimatorBase _parent; - - public AnimatorWrapper(CustomAnimatorBase parent) - { - _parent = parent; - } - - public override T Interpolate(double progress, T oldValue, T newValue) => _parent.Interpolate(progress, oldValue, newValue); - } -} - public interface ICustomAnimator { internal IAnimator CreateWrapper(); @@ -55,4 +27,4 @@ public abstract class InterpolatingAnimator : ICustomAnimator public override T Interpolate(double progress, T oldValue, T newValue) => _parent.Interpolate(progress, oldValue, newValue); } -} \ No newline at end of file +}