{"record":{"id":"411abb5b14adfe3c","repo":"AvaloniaUI/Avalonia","slug":"no-setter-property-assigned","errorCode":null,"errorMessage":"No Setter property assigned.","messagePattern":"No Setter property assigned\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Animation/Animation.cs","lineNumber":231,"sourceCode":"                return type;\n            }\n            return null;\n        }\n\n        private (IList<IAnimator> Animators, IList<IDisposable> subscriptions, bool animatesVisibility) InterpretKeyframes(Animatable control)\n        {\n            var handlerList = new Dictionary<(Type type, AvaloniaProperty Property), Func<IAnimator>>();\n            var animatorKeyFrames = new List<AnimatorKeyFrame>();\n            var subscriptions = new List<IDisposable>();\n            var animatesVisibility = false;\n\n            foreach (var keyframe in Children)\n            {\n                foreach (var setter in keyframe.Setters)\n                {\n                    if (setter.Property is null)\n                    {\n                        throw new InvalidOperationException(\"No Setter property assigned.\");\n                    }\n\n                    if (setter.Property == Visual.IsVisibleProperty)\n                        animatesVisibility = true;\n\n                    var handler = Animation.GetAnimator(setter) ?? GetAnimatorType(setter.Property);\n\n                    if (handler == null)\n                    {\n                        throw new InvalidOperationException($\"No animator registered for the property {setter.Property}. Add an animator to the Animation.Animators collection that matches this property to animate it.\");\n                    }\n\n                    var (type, factory) = handler.Value;\n\n                    if (!handlerList.ContainsKey((type, setter.Property)))\n                        handlerList[(type, setter.Property)] = factory;\n\n                    var cue = keyframe.Cue;","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Animation/Animation.cs#L213-L249","documentation":"Thrown during Animation.InterpretKeyframes when a Setter inside a KeyFrame has a null Property. Each setter must target a specific AvaloniaProperty; a null Property makes the keyframe meaningless and prevents animator resolution, so Avalonia fails fast during the animation setup pass.","triggerScenarios":"Defining a KeyFrame Setter in XAML or code without specifying the Property attribute/property (e.g. <Setter Value=\"Red\"/> missing Property=...). Also reachable by programmatically adding a Setter whose Property was never assigned.","commonSituations":"XAML typo omitting the Property attribute on a Setter; building Setters in code and forgetting to set .Property; copy/paste of a Setter that lost its Property binding; stale XAML after renaming/removing an AvaloniaProperty without updating the setter.","solutions":["Add the Property attribute to every Setter in the animation's keyframes (e.g. <Setter Property=\"Opacity\" Value=\"1\"/>).","If constructing Setters in code, always assign setter.Property = SomeControl.SomeProperty before adding to the keyframe.","Validate all Setters in a KeyFrame have a non-null Property before running/initializing the animation.","After renaming an AvaloniaProperty, update all animation setters referencing it."],"exampleFix":"// before\n<!-- XAML -->\n<KeyFrame>\n  <Setter Value=\"1.0\"/>\n</KeyFrame>\n\n// after\n<KeyFrame>\n  <Setter Property=\"Opacity\" Value=\"1.0\"/>\n</KeyFrame>","handlingStrategy":"validation","validationCode":"// ensure every setter has a Property before running the animation\nforeach (var kf in animation.Children)\n    foreach (var s in kf.Setters)\n        if (s.Property is null)\n            throw new InvalidOperationException($\"Setter is missing a Property (value={s.Value}).\");","typeGuard":"static bool AllSettersHaveProperty(Animation a)\n    => a.Children.SelectMany(k => k.Setters).All(s => s.Property is not null);","tryCatchPattern":null,"preventionTips":["Always set Property on every Setter in XAML and code-behind.","Validate setters before initializing/running animations.","Update animation setters after renaming/removing an AvaloniaProperty.","Lint XAML for Setters missing the Property attribute."],"tags":["animation","xaml","setter","keyframe","validation"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}