unoplatform/uno · error · Exception
Expected ')' in attached property syntax.
Error message
Expected ')' in attached property syntax.
What it means
Thrown by the x:Bind path parser during attached-property syntax parsing. After '.(' is consumed and the inner path is confirmed to be a member access node 'Owner.Property', the parser checks for the closing ')'. If the next character is not ')', this exception fires.
Source
Thrown at src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/Utils/XBindExpressionParser.CoreParser.cs:194
while (true)
{
if (Current == '.')
{
_position++;
if (Current == '(')
{
_position++;
var attachedPropertyPath = ParseXBindPath();
if (attachedPropertyPath is not XBindMemberAccess memberAccess)
{
throw new Exception("Expected attached property path to be member access.");
}
if (Current != ')')
{
throw new Exception("Expected ')' in attached property syntax.");
}
path = new XBindAttachedPropertyAccess() { Member = path, PropertyClass = memberAccess.Path, PropertyName = memberAccess.Identifier };
_position++;
}
else
{
path = new XBindMemberAccess() { Path = path, Identifier = ParseXBindIdentifier() };
}
}
else if (Current == '[')
{
var currentPosition = ++_position;
while (Current != ']')
{
_position++;
}View on GitHub (pinned to 0418340488)
Solutions
- Add the missing ')' immediately after 'ClassName.PropertyName' in the '.(...)' group.
- Remove any stray characters between the property name and the closing ')'.
- Validate the full x:Bind string reads as Element.(Class.Property).
Example fix
<!-- before -->
<Text Canvas.Left="{x:Bind MyElement.(Canvas.Left}" />
<!-- after -->
<Text Canvas.Left="{x:Bind MyElement.(Canvas.Left)}" /> Defensive patterns
Strategy: validation
Validate before calling
// Ensure the closing ')' is present in attached-property x:Bind syntax.
// Linting check: every '.(' in an x:Bind path must be followed eventually by ')'
// after exactly 'Class.Property'. Prevention
- Double-check closing ')' when writing attached property bindings.
- Use IDE autocomplete/snippets that insert the full '.(Class.Property)' pattern.
When it happens
Trigger: An x:Bind attached-property path is missing its closing ')' — e.g. {x:Bind Element.(Canvas.Left} or {x:Bind Element.(Canvas.Left. Extra}.
Common situations: Typo or truncation in the closing parenthesis of an attached property path; an XAML merge or formatter introduced an extra character between the property name and ')'.
Related errors
- Expected attached property path to be member access.
- Missing parenthesis?
- Invalid identifier character {Current}
- x:Bind indexing expects a single literal argument
- Only properties and fields can be indexed.
AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13).
Data as JSON: /api/errors/caa5ed231adca15e.
Report an issue: GitHub.