{"record":{"id":"929ab37075f78256","repo":"AvaloniaUI/Avalonia","slug":"transition-has-no-property-specified-929ab3","errorCode":null,"errorMessage":"Transition has no property specified.","messagePattern":"Transition has no property specified\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Animation/TransitionBase.cs","lineNumber":91,"sourceCode":"        /// Gets the easing class to be used.\n        /// </summary>\n        public Easing Easing\n        {\n            get { return _easing; }\n            set { SetAndRaise(EasingProperty, ref _easing, value); }\n        }\n\n        /// <inheritdoc cref=\"ITransition.Property\"/>\n        [DisallowNull]\n        public AvaloniaProperty? Property\n        {\n            get { return _prop; }\n            set { SetAndRaise(PropertyProperty, ref _prop, value); }\n        }\n\n        AvaloniaProperty ITransition.Property\n        {\n            get => Property ?? throw new InvalidOperationException(\"Transition has no property specified.\");\n            set => Property = value;\n        }\n\n        /// <inheritdoc/>\n        IDisposable ITransition.Apply(Animatable control, IClock clock, object? oldValue, object? newValue)\n            => Apply(control, clock, oldValue, newValue);\n        \n        internal abstract IDisposable Apply(Animatable control, IClock clock, object? oldValue, object? newValue);\n\n        internal override void BuildDebugDisplay(StringBuilder builder, bool includeContent)\n        {\n            base.BuildDebugDisplay(builder, includeContent);\n            DebugDisplayHelper.AppendOptionalValue(builder, nameof(Property), Property, includeContent);\n            DebugDisplayHelper.AppendOptionalValue(builder, nameof(Duration), Duration, includeContent);\n        }\n    }\n}\n","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Animation/TransitionBase.cs#L73-L109","documentation":"Thrown by the explicit ITransition.Property getter when the public Property is null. Accessing Property through the ITransition interface is treated as required, so a null backing field is a contract violation. This is distinct from [85]: here the throw is on read of the interface-typed Property, not on Apply.","triggerScenarios":"Code holding an ITransition reference (not the concrete TransitionBase) reads .Property on a transition that never had Property set; framework internals iterating transitions and reading Property for validation.","commonSituations":"Adding an incompletely-configured transition to a collection; reflection/serialization code that reads ITransition.Property defensively.","solutions":["Always set Property on every transition before exposing or reading it as ITransition.","When you only have an ITransition, check the public Property via the TransitionBase cast or guard reads in a try/catch.","Unit-test transition construction to assert Property is assigned."],"exampleFix":"// before\nITransition it = new DoubleTransition { Duration = TimeSpan.FromSeconds(0.3) };\nvar p = it.Property; // throws\n\n// after\nITransition it = new DoubleTransition { Duration = TimeSpan.FromSeconds(0.3), Property = Visual.OpacityProperty };\nvar p = it.Property;","handlingStrategy":"validation","validationCode":"AvaloniaProperty? p = (transition as TransitionBase)?.Property;\nif (p is null) { /* configure before reading via ITransition */ }","typeGuard":"static bool HasProperty(ITransition t) => (t as TransitionBase)?.Property is not null;","tryCatchPattern":"AvaloniaProperty p;\ntry { p = it.Property; }\ncatch (InvalidOperationException) { return; /* skip unconfigured */ }","preventionTips":["Prefer the TransitionBase-typed Property (nullable) for defensive reads.","Construct transitions with Property set in one expression."],"tags":["animation","transition","invalid-operation","configuration"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}