{"record":{"id":"4e332750e18e4526","repo":"AvaloniaUI/Avalonia","slug":"animator-has-no-property-specified","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/Animation/AnimationInstance`1.cs","lineNumber":217,"sourceCode":"                    return;\n\n                InternalStep(frameTick);\n            }\n            catch (Exception e)\n            {\n                PublishError(e);\n            }\n        }\n\n        private bool CanApplyFinalFill()\n        {\n            return _fillMode is FillMode.Forward or FillMode.Both;\n        }\n\n        private void ApplyFinalFill(T interpolatedValue)\n        {\n            if (_animator.Property is null)\n                throw new InvalidOperationException(\"Animator has no property specified.\");\n            _targetControl.SetValue(_animator.Property, interpolatedValue);\n        }\n\n        private void DoComplete(bool stopAsIs)\n        {\n            if (!stopAsIs)\n            {\n                // Update _lastInterpValue because PublishCompleted might perform final fill\n                // and we should ensure that filled value is snapped to last value that animation would\n                // reach if it was left running in current state.\n                var isIterationReversed = IsIterationReversed(IsAlternatingPlaybackDirection(), _iterationCount + 1);\n                _lastInterpValue = FindEdgeValue(IsAnimTimeGoingBackwards(), isIterationReversed);\n            }\n            _onCompleteAction?.Invoke();\n            PublishCompleted();\n        }\n\n        private void DoInitialDelay()","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Animation/AnimationInstance`1.cs#L199-L235","documentation":"Thrown by AnimationInstance<T>.ApplyFinalFill when applying the end-of-animation fill value: the Animator's target AvaloniaProperty is null. FillMode.Forward or FillMode.Both requests a final fill, but no property was declared on the Animator to write the value to.","triggerScenarios":"Running an animation with FillMode.Forward/Both on an Animator whose Property was never set; triggered at Unsubscribed -> CanApplyFinalFill -> ApplyFinalFill.","commonSituations":"Defining a code-behind Animator and forgetting to set .Property; building an Animator from XAML where the Property attribute is missing or misspelled.","solutions":["Set the Animator.Property to the target AvaloniaProperty (e.g. Visual.OpacityProperty) before running.","Switch FillMode to None so no final fill is attempted (only if fill is genuinely unwanted).","Verify in XAML that the Animator carries the Property= attribute."],"exampleFix":"// before\nvar animator = new DoubleAnimator(); // Property not set\nanimation.FillMode = FillMode.Forward;\n\n// after\nvar animator = new DoubleAnimator { Property = Visual.OpacityProperty };","handlingStrategy":"type-guard","validationCode":"if (animator.Property is null)\n    throw new InvalidOperationException(\"Animator.Property must be set before using FillMode.Forward/Both.\");","typeGuard":"static bool HasProperty(Animator a) => a.Property is not null;","tryCatchPattern":null,"preventionTips":["Always set Animator.Property at construction time.","Use FillMode.None if you cannot guarantee a Property is set.","Centralize Animator creation in a helper that requires a Property argument."],"tags":["animation","configuration","nullable-property","avalonia"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}