{"record":{"id":"b4af2cac479c40fd","repo":"AvaloniaUI/Avalonia","slug":"animator-has-no-property-specified-b4af2c","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/SolidColorBrushAnimator.cs","lineNumber":33,"sourceCode":"        private static readonly DoubleAnimator s_doubleAnimator = new DoubleAnimator();\n\n        public override ISolidColorBrush? Interpolate(double progress, ISolidColorBrush? oldValue, ISolidColorBrush? newValue)\n        {\n            if (oldValue is null || newValue is null)\n            {\n                return progress >= 0.5 ? newValue : oldValue;\n            }\n\n            return new ImmutableSolidColorBrush(\n                ColorAnimator.InterpolateCore(progress, oldValue.Color, newValue.Color),\n                s_doubleAnimator.Interpolate(progress, oldValue.Opacity, newValue.Opacity));\n        }\n\n        public override IDisposable BindAnimation(Animatable control, IObservable<ISolidColorBrush?> instance)\n        {\n            if (Property is null)\n            {\n                throw new InvalidOperationException(\"Animator has no property specified.\");\n            }\n\n            return control.Bind((AvaloniaProperty<IBrush?>)Property, instance, BindingPriority.Animation);\n        }\n    }\n    \n}\n","sourceCodeStart":15,"sourceCodeEnd":41,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Animation/Animators/SolidColorBrushAnimator.cs#L15-L41","documentation":"Thrown by SolidColorBrushAnimator.BindAnimation when Property is null. The solid-color animator binds an ISolidColorBrush observable to the target control's property and requires a non-null AvaloniaProperty.","triggerScenarios":"Calling Animation.Play with a SolidColorBrushAnimator that has no Property assigned.","commonSituations":"Constructing a SolidColorBrushAnimator in code without setting Property; XAML Animator element missing the Property attribute.","solutions":["Set SolidColorBrushAnimator.Property to the brush target property before playing.","Ensure the target property is brush-typed (Background, Foreground, BorderBrush).","Confirm the Animator is wired through the correct property in XAML."],"exampleFix":"// before\nvar animator = new SolidColorBrushAnimator();\n\n// after\nvar animator = new SolidColorBrushAnimator { Property = Control.BackgroundProperty };","handlingStrategy":"type-guard","validationCode":"if (animator.Property is null)\n    throw new InvalidOperationException(\"SolidColorBrushAnimator.Property must be set.\");","typeGuard":"static bool HasProperty(SolidColorBrushAnimator a) => a.Property is not null;","tryCatchPattern":null,"preventionTips":["Set SolidColorBrushAnimator.Property to a brush-typed property at construction.","Confirm the target property accepts IBrush.","Validate Property before Play."],"tags":["animation","configuration","nullable-property","brush","avalonia"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}