{"record":{"id":"6c53001e171440b6","repo":"unoplatform/uno","slug":"expected-end-of-x-bind-expression-or-start-of-argu","errorCode":null,"errorMessage":"Expected end of x:Bind expression or start of argument list.","messagePattern":"Expected end of x:Bind expression or start of argument list\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs","lineNumber":52,"sourceCode":"\t\t}\n\n\t\tpublic XBindRoot ParseXBind()\n\t\t{\n\t\t\tDebug.Assert(_position == 0, \"ParseXBind should be called on the whole expression.\");\n\t\t\tif (string.IsNullOrWhiteSpace(_xBind))\n\t\t\t{\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tvar bindPath = ParseXBindPath();\n\t\t\tif (IsDone)\n\t\t\t{\n\t\t\t\treturn bindPath;\n\t\t\t}\n\n\t\t\tif (Current != '(')\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Expected end of x:Bind expression or start of argument list.\");\n\t\t\t}\n\n\t\t\t_position++;\n\t\t\tif (Current == ')')\n\t\t\t{\n\t\t\t\t_position++;\n\t\t\t\tif (IsDone)\n\t\t\t\t{\n\t\t\t\t\treturn new XBindInvocation() { Path = bindPath, Arguments = Array.Empty<XBindArgument>() };\n\t\t\t\t}\n\n\t\t\t\tthrow new Exception(\"Expected end of expression after invocation.\");\n\t\t\t}\n\n\n\t\t\tvar arguments = new List<XBindArgument>();\n\t\t\targuments.Add(ParseXBindArgument());\n\t\t\twhile (Current == ',')","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs#L34-L70","documentation":"XBindExpressionParser parses an x:Bind expression as a path optionally followed by an invocation. After the bind path, the only legal continuation is '(' to start an argument list; any other trailing token (operator, stray identifier, etc.) is invalid and throws.","triggerScenarios":"An x:Bind expression has non-invocation trailing content after the path, e.g. {x:Bind Foo.Bar baz}, {x:Bind A+B}, or {x:Bind Foo;bar}.","commonSituations":"Hand-edited XAML with a malformed x:Bind; attempting an unsupported expression form (arithmetic/logic) that x:Bind does not parse here.","solutions":["Remove the trailing content so the x:Bind is a plain path or a path(args) invocation.","Move computed expressions into a bound method/property and bind to that.","Re-check the x:Bind syntax for stray characters."],"exampleFix":"<!-- before -->\n<TextBlock Text=\"{x:Bind Foo.Bar baz}\" />\n<!-- after -->\n<TextBlock Text=\"{x:Bind Foo.Bar}\" />","handlingStrategy":"validation","validationCode":"// Lint x:Bind: after the path, only '(' (invocation) or end-of-input is legal.\n// Run a XAML linter that parses {x:Bind ...} and rejects stray trailing tokens.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep x:Bind expressions to a path or a path(args) invocation; do arithmetic in bound code.","Lint XAML for malformed x:Bind before committing."],"tags":["xaml","xbind","parser","binding"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}