{"record":{"id":"06b378b0a5798c67","repo":"dotnet/maui","slug":"can-t-resolve-parts-0","errorCode":null,"errorMessage":"Can't resolve {parts[0]}","messagePattern":"Can't resolve (.+?)","errorType":"exception","errorClass":"XamlParseException","httpStatus":null,"severity":"error","filePath":"src/Controls/src/Core/BindablePropertyConverter.cs","lineNumber":60,"sourceCode":"\t\t\t\t\tthrow new XamlParseException(msg, lineinfo);\n\t\t\t\t}\n\t\t\t\tobject parent = parentValuesProvider.ParentObjects.Skip(1).FirstOrDefault();\n\t\t\t\tif (parentValuesProvider.TargetObject is Setter)\n\t\t\t\t{\n\t\t\t\t\tif (parent is Style style)\n\t\t\t\t\t\ttype = style.TargetType;\n\t\t\t\t\telse if (parent is TriggerBase triggerBase)\n\t\t\t\t\t\ttype = triggerBase.TargetType;\n\t\t\t\t\telse if (parent is VisualState visualState)\n\t\t\t\t\t\ttype = FindTypeForVisualState(parentValuesProvider, lineinfo);\n\t\t\t\t}\n\t\t\t\telse if (parentValuesProvider.TargetObject is Trigger)\n\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();","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Controls/src/Core/BindablePropertyConverter.cs#L42-L78","documentation":"XamlParseException raised after the converter walked the parent chain for a single-segment property name but could not determine an owning Type. It tried Setter/Style, TriggerBase, VisualState, Trigger, and PropertyCondition branches; none matched, so type stayed null and the converter refuses to guess which BindableProperty the bare name refers to.","triggerScenarios":"A bare property name inside an element whose parent chain is not one of the recognized shapes (Setter in Style/Trigger/VisualState). For example a Setter nested in an unsupported container, or a custom markup that places Setter somewhere the converter does not look.","commonSituations":"Hand-authored or tool-generated XAML that nests Setter/Trigger in unusual parents; custom TriggerBase subclasses; XAML written for an older API surface that has since changed parent expectations.","solutions":["Qualify the property with its owner type: Property=\"VisualElement.BackgroundColor\".","Move the Setter into a recognized parent (Style, Trigger, or VisualStateGroup/VisualState chain).","If the parent is a custom TriggerBase, ensure it exposes TargetType so the converter can read it."],"exampleFix":"<!-- before -->\n<Setter Property=\"BackgroundColor\" Value=\"Red\" />\n\n<!-- after -->\n<Setter Property=\"VisualElement.BackgroundColor\" Value=\"Red\" />","handlingStrategy":"validation","validationCode":"// Prefer qualified property names in Setters that may sit in non-standard parents:\n// Property=\"VisualElement.BackgroundColor\"","typeGuard":null,"tryCatchPattern":"try { /* compile XAML */ }\ncatch (XamlParseException ex) when (ex.Message.Contains(\"Can't resolve\"))\n{\n    // instruct the author to qualify the property name\n}","preventionTips":["Always qualify bare property names with the owning type in Setters.","Keep Setter inside recognized parents (Style/Trigger/VisualState)."],"tags":["maui","xaml","bindableproperty","converter","type-resolution"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}