{"record":{"id":"f96a7dabe9aba9e7","repo":"AvaloniaUI/Avalonia","slug":"attached-properties-not-supported","errorCode":null,"errorMessage":"Attached properties not supported.","messagePattern":"Attached properties not supported\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/AvaloniaPropertyRegistry.cs","lineNumber":287,"sourceCode":"        /// <summary>\n        /// Finds a registered property on a type by name.\n        /// </summary>\n        /// <param name=\"type\">The type.</param>\n        /// <param name=\"name\">The property name.</param>\n        /// <returns>\n        /// The registered property or null if no matching property found.\n        /// </returns>\n        /// <exception cref=\"InvalidOperationException\">\n        /// The property name contains a '.'.\n        /// </exception>\n        public AvaloniaProperty? FindRegistered(Type type, string name)\n        {\n            _ = type ?? throw new ArgumentNullException(nameof(type));\n            _ = name ?? throw new ArgumentNullException(nameof(name));\n\n            if (name.Contains('.'))\n            {\n                throw new InvalidOperationException(\"Attached properties not supported.\");\n            }\n\n            var registered = GetRegistered(type);\n            var registeredCount = registered.Count;\n\n            for (var i = 0; i < registeredCount; i++)\n            {\n                AvaloniaProperty x = registered[i];\n\n                if (x.Name == name)\n                {\n                    return x;\n                }\n            }\n\n            return null;\n        }\n","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/AvaloniaPropertyRegistry.cs#L269-L305","documentation":"Thrown by AvaloniaPropertyRegistry.FindRegistered(Type, string) when the requested property name contains a dot. Dotted names (e.g. 'Grid.Row') denote attached properties, which this by-name lookup API does not resolve — attached properties live in a separate registry and must be looked up via the attached-property APIs.","triggerScenarios":"Calling FindRegistered(type, \"OwnerType.PropertyName\") or FindRegistered(obj, \"Canvas.Left\"); passing an XAML-style attached property path to the non-attached name-based lookup.","commonSituations":"Binding or styling code that passes an attached-property qualified name where a plain CLR property name is expected; XAML parser or reflection code forwarding a dotted path into FindRegistered.","solutions":["Strip the 'OwnerType.' prefix and resolve the attached property through GetRegisteredAttached(type) / Find on the attached registry instead.","Use the property name without the dot for non-attached lookups.","Detect the dot up front and branch to the attached-property resolution path."],"exampleFix":"// before\nvar p = registry.FindRegistered(type, \"Canvas.Left\");\n\n// after\nif (name.Contains('.')) {\n    var attached = registry.GetRegisteredAttached(type)\n        .FirstOrDefault(a => a.Name == name.Split('.')[1]);\n} else {\n    var p = registry.FindRegistered(type, name);\n}","handlingStrategy":"validation","validationCode":"if (name.Contains('.')) { /* resolve via GetRegisteredAttached instead */ }","typeGuard":"static bool IsPlainPropertyName(string name) => !name.Contains('.');","tryCatchPattern":null,"preventionTips":["Detect dotted names before calling FindRegistered and route to the attached-property API.","Keep attached-property qualified names out of non-attached lookups.","Validate input names at the boundary (binding/XAML parser)."],"tags":["avalonia","property-system","attached-property","validation"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}