{"record":{"id":"819682fecb12cb38","repo":"AvaloniaUI/Avalonia","slug":"animator-has-no-property-specified-819682","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/Animators/TransformAnimator.cs","lineNumber":24,"sourceCode":"\nnamespace Avalonia.Animation.Animators\n{\n    /// <summary>\n    /// Animator that handles <see cref=\"Transform\"/> properties.\n    /// </summary>\n    internal class TransformAnimator : Animator<double>\n    {\n        DoubleAnimator? _doubleAnimator;\n\n        /// <inheritdoc/>\n        public override IDisposable? Apply(Animation animation, Animatable control, IClock? clock,\n            IObservable<bool> obsMatch, Action? onComplete, bool shouldPauseOnInvisible)\n        {\n            var ctrl = (Visual)control;\n\n            if (Property is null)\n            {\n                throw new InvalidOperationException(\"Animator has no property specified.\");\n            }\n\n            // Check if the Target Property is Transform derived.\n            if (typeof(Transform).IsAssignableFrom(Property.OwnerType))\n            {\n                if (ctrl.RenderTransform is TransformOperations)\n                {\n                    // HACK: This animator cannot reasonably animate CSS transforms at the moment.\n                    return Disposable.Empty;\n                }\n\n                if (ctrl.RenderTransform == null)\n                {\n                    var normalTransform = new TransformGroup();\n\n                    // Add the transforms according to MS Expression Blend's \n                    // default RenderTransform order.\n","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Animation/Animators/TransformAnimator.cs#L6-L42","documentation":"Thrown by TransformAnimator.Apply when Property is null. TransformAnimator casts the control to Visual and must know which transform-derived AvaloniaProperty to animate, so it rejects a missing Property at apply time.","triggerScenarios":"Calling Apply on a TransformAnimator that has no Property set; reached before the RenderTransform type check.","commonSituations":"Building a TransformAnimator in code-behind and forgetting Property; XAML Animator element missing the Property attribute for a transform animation.","solutions":["Set TransformAnimator.Property to a transform-derived AvaloniaProperty before applying.","Ensure Property.OwnerType is assignable from Transform (the animator checks this right after the null guard).","Use TransformOperationsAnimator if you are animating CSS-style transform operations instead."],"exampleFix":"// before\nvar animator = new TransformAnimator();\n\n// after\nvar animator = new TransformAnimator { Property = Visual.RenderTransformProperty };","handlingStrategy":"type-guard","validationCode":"if (animator.Property is null)\n    throw new InvalidOperationException(\"TransformAnimator.Property must be set.\");\nif (!typeof(Transform).IsAssignableFrom(animator.Property.OwnerType))\n    throw new InvalidOperationException(\"TransformAnimator.Property must be transform-derived.\");","typeGuard":"static bool PropertyIsTransform(AvaloniaProperty? p) => p is not null && typeof(Transform).IsAssignableFrom(p.OwnerType);","tryCatchPattern":null,"preventionTips":["Set TransformAnimator.Property to a transform-derived AvaloniaProperty.","Use TransformOperationsAnimator for CSS-style transform operations.","Validate OwnerType is transform-derived before Apply."],"tags":["animation","configuration","nullable-property","transform","avalonia"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}