{"record":{"id":"9861a866a6f45c51","repo":"AvaloniaUI/Avalonia","slug":"animator-has-no-property-specified-9861a8","errorCode":null,"errorMessage":"Animator has no property specified.","messagePattern":"Animator has no property specified\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Media/Effects/EffectAnimator.cs","lineNumber":77,"sourceCode":"    /// </summary>\n    public override IEffect? Interpolate(double progress, IEffect? oldValue, IEffect? newValue) => progress >= 0.5 ? newValue : oldValue;\n\n    private static bool s_Registered;\n    public static void EnsureRegistered()\n    {\n        if(s_Registered)\n            return;\n        s_Registered = true;\n    }\n}\n\ninternal abstract class EffectAnimatorBase<T> : Animator<IEffect?> where T : class, IEffect?\n{\n    public override IDisposable BindAnimation(Animatable control, IObservable<IEffect?> instance)\n    {\n        if (Property is null)\n        {\n            throw new InvalidOperationException(\"Animator has no property specified.\");\n        }\n\n        return control.Bind((AvaloniaProperty<IEffect?>)Property, instance, BindingPriority.Animation);\n    }\n\n    protected abstract T Interpolate(double progress, T oldValue, T newValue);\n    public override IEffect? Interpolate(double progress, IEffect? oldValue, IEffect? newValue)\n    {\n        var old = oldValue as T;\n        var n = newValue as T;\n        if (old == null || n == null)\n            return progress >= 0.5 ? newValue : oldValue;\n        return Interpolate(progress, old, n);\n    }\n}\n\ninternal class BlurEffectAnimator : EffectAnimatorBase<IBlurEffect>\n{","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Media/Effects/EffectAnimator.cs#L59-L95","documentation":"EffectAnimatorBase.BindAnimation throws when the Animator's Property is null — it cannot bind an animation without knowing which AvaloniaProperty to drive. The animator base class requires a Property set (typically via XAML/animation registration) before binding. A null Property indicates the animator was constructed/registered without specifying its target property.","triggerScenarios":"An EffectAnimator (or subclass) instance has its Property left null when BindAnimation is called by the animation system. Typically happens during animation registration/playback if the animator wasn't fully initialized.","commonSituations":"Custom effect animator subclass that doesn't set Property. Registering an animation where the property binding was omitted. A XAML/C# animation definition missing the target AvaloniaProperty. Misuse of the animation API where an animator is reused without resetting Property.","solutions":["Ensure the animator's Property is set to a valid AvaloniaProperty<IEffect?> before binding/playing.","If registering via the animation system, confirm the property is specified in the Animation/KeyFrames or registration call.","Add a constructor or initialization that validates Property is non-null before use."],"exampleFix":"// before\nvar animator = new MyEffectAnimator();\nanimator.BindAnimation(control, instance); // Property is null\n\n// after\nvar animator = new MyEffectAnimator { Property = Visual.EffectProperty };\nanimator.BindAnimation(control, instance);","handlingStrategy":"validation","validationCode":"if (animator.Property is null)\n    throw new InvalidOperationException(\"Animator.Property must be set before binding.\");\nanimator.BindAnimation(control, instance);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set animator.Property (typically to an AvaloniaProperty<IEffect?>) before binding.","Initialize animators via constructors that require the property.","Add an assertion/guard in custom animator subclasses' BindAnimation."],"tags":["animation","effect","binding","animator","property"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}