{"record":{"id":"d681212f4e5d7c88","repo":"AvaloniaUI/Avalonia","slug":"name-may-not-contain-periods","errorCode":null,"errorMessage":"'name' may not contain periods.","messagePattern":"'name' may not contain periods\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/AvaloniaProperty.cs","lineNumber":62,"sourceCode":"        /// <param name=\"hostType\">The class that the property being is registered on.</param>\n        /// <param name=\"metadata\">The property metadata.</param>\n        /// <param name=\"notifying\">A <see cref=\"Notifying\"/> callback.</param>\n        private protected AvaloniaProperty(\n            string name,\n            Type valueType,\n            Type ownerType,\n            Type hostType,\n            AvaloniaPropertyMetadata metadata,\n            Action<AvaloniaObject, bool>? notifying = null)\n        {\n            ThrowHelper.ThrowIfNull(name, nameof(name));\n            ThrowHelper.ThrowIfNull(valueType, nameof(valueType));\n            ThrowHelper.ThrowIfNull(ownerType, nameof(ownerType));\n            ThrowHelper.ThrowIfNull(metadata, nameof(metadata));\n\n            if (name.Contains('.'))\n            {\n                throw new ArgumentException(\"'name' may not contain periods.\");\n            }\n\n            Name = name;\n            PropertyType = valueType;\n            OwnerType = ownerType;\n            Notifying = notifying;\n            Id = s_nextId++;\n\n            metadata.Freeze();\n            _metadata.Add(hostType, metadata);\n            _defaultMetadata = metadata.GenerateTypeSafeMetadata();\n            _singleHostType = hostType;\n            _singleMetadata = metadata;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AvaloniaProperty\"/> class.\n        /// </summary>","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/AvaloniaProperty.cs#L44-L80","documentation":"Thrown by the AvaloniaProperty constructor when the registered name contains a '.' (period). Periods are reserved because Avalonia uses 'Owner.Property' syntax to reference attached properties in XAML and bindings, so a dotted name would create parsing ambiguity.","triggerScenarios":"Calling AvaloniaProperty.Register/RegisterAttached/RegisterDirect with a name argument like 'Foo.Bar'; programmatically building a property name that includes the owner prefix.","commonSituations":"Copy-pasting the 'Owner.Member' qualified name from XAML into the Register name argument; code generators emitting fully-qualified names.","solutions":["Pass only the unqualified member name (e.g. 'Left' for DockPanel.Left).","Strip the owner prefix before registering.","For attached properties the owner association is handled by RegisterAttached's owner type parameter, not by the name."],"exampleFix":"// before\nAvaloniaProperty.Register<Grid, int>(\"Grid.Row\", ...);\n\n// after\nAvaloniaProperty.Register<Grid, int>(\"Row\", ...);","handlingStrategy":"validation","validationCode":"if (name.Contains('.'))\n    name = name.Substring(name.LastIndexOf('.') + 1);","typeGuard":"static bool IsValidPropertyName(string name) =>\n    !string.IsNullOrWhiteSpace(name) && !name.Contains('.');","tryCatchPattern":null,"preventionTips":["Pass only the unqualified member name to Register.","Strip owner prefixes from code-generated names."],"tags":["property-system","registration","argument","xaml"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}