{"record":{"id":"9278604e145a069f","repo":"dotnet/maui","slug":"can-t-resolve-value-syntax-is-prefix-type-p","errorCode":null,"errorMessage":"Can't resolve {value}. Syntax is [[prefix:]Type.]PropertyName.","messagePattern":"Can't resolve (.+?)\\. Syntax is \\[\\[prefix:\\]Type\\.\\]PropertyName\\.","errorType":"exception","errorClass":"XamlParseException","httpStatus":null,"severity":"error","filePath":"src/Controls/src/Core/BindablePropertyConverter.cs","lineNumber":73,"sourceCode":"\t\t\t\t\ttype = (parentValuesProvider.TargetObject as Trigger).TargetType;\n\t\t\t\telse if (parentValuesProvider.TargetObject is PropertyCondition && parent is TriggerBase)\n\t\t\t\t\ttype = (parent as TriggerBase).TargetType;\n\n\t\t\t\tif (type == null)\n\t\t\t\t\tthrow new XamlParseException($\"Can't resolve {parts[0]}\", lineinfo);\n\n\t\t\t\treturn ConvertFrom(type, parts[0], lineinfo);\n\t\t\t}\n\t\t\tif (parts.Length == 2)\n\t\t\t{\n\t\t\t\tif (!typeResolver.TryResolve(parts[0], out type))\n\t\t\t\t{\n\t\t\t\t\tstring msg = string.Format(\"Can't resolve {0}\", parts[0]);\n\t\t\t\t\tthrow new XamlParseException(msg, lineinfo);\n\t\t\t\t}\n\t\t\t\treturn ConvertFrom(type, parts[1], lineinfo);\n\t\t\t}\n\t\t\tthrow new XamlParseException($\"Can't resolve {value}. Syntax is [[prefix:]Type.]PropertyName.\", lineinfo);\n\t\t}\n\n\t\tpublic override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)\n\t\t{\n\t\t\tvar strValue = value?.ToString();\n\n\t\t\tif (string.IsNullOrWhiteSpace(strValue))\n\t\t\t\treturn null;\n\t\t\tif (strValue.IndexOf(\":\", StringComparison.Ordinal) != -1)\n\t\t\t{\n\t\t\t\tApplication.Current?.FindMauiContext()?.CreateLogger<BindablePropertyConverter>()?.LogWarning(\"Can't resolve properties with xml namespace prefix.\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tstring[] parts = strValue.Split('.');\n\t\t\tif (parts.Length != 2)\n\t\t\t{\n\t\t\t\tApplication.Current?.FindMauiContext()?.CreateLogger<BindablePropertyConverter>()?.LogWarning($\"Can't resolve {value}. Accepted syntax is Type.PropertyName.\");\n\t\t\t\treturn null;","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Controls/src/Core/BindablePropertyConverter.cs#L55-L91","documentation":"XamlParseException raised when the value split on '.' does not have exactly 1 or 2 segments. The converter only understands bare PropertyName or Type.PropertyName; anything else (zero segments, three or more, or a leading/trailing dot) is syntactically invalid and is rejected with a syntax hint.","triggerScenarios":"Property=\"A.B.C\" (three segments); Property=\".Foo\" or \"Foo.\" (leading/trailing dot); Property=\"\" or whitespace that survived the earlier IsNullOrWhiteSpace check; a value that accidentally contains a dot inside a namespace token.","commonSituations":"Typos; copy-paste from a different binding syntax; trying to write an attached-property path with extra dots; XAML tools that emit malformed attributes.","solutions":["Use the supported syntax: either PropertyName or Type.PropertyName.","For attached properties, use the form Type.PropertyName (e.g. Grid.Column).","Remove stray dots or extra segments from the attribute."],"exampleFix":"<!-- before -->\n<Setter Property=\"A.B.C\" Value=\"1\" />\n\n<!-- after -->\n<Setter Property=\"Grid.Column\" Value=\"1\" />","handlingStrategy":"validation","validationCode":"// Validate the property token has exactly one or two dot-separated segments before use.\nstatic bool IsValidPropertySyntax(string s)\n{\n    if (string.IsNullOrWhiteSpace(s)) return false;\n    var n = s.Split('.').Length;\n    return n == 1 || n == 2;\n}","typeGuard":"static bool IsValidPropertySyntax(string s) =>\n    !string.IsNullOrWhiteSpace(s) && (s.Split('.').Length is 1 or 2);","tryCatchPattern":null,"preventionTips":["Use only PropertyName or Type.PropertyName forms.","Lint XAML attributes for stray dots before build."],"tags":["maui","xaml","bindableproperty","converter","syntax"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}