Collection syntax in XAML should only be supported when setting property values using property element syntax and not attribute syntax.
Adds a property to XamlAstXamlPropertyValueNode to indicate whether the property value came from an attribute, and a property to PropertySetterBinderParameters to indicate whether a setter can be used from an attribute.
The AdderSetters set PropertySetterBinderParameters.AllowAttributeSyntax to false, which disallows their usage from attribute XamlAstXamlPropertyValueNodes.
Updated the unit tests to ensure that markup extensions cannot now be used to add items to read-only collections (but can be used to assign lists to read-write collection properties).
Collection syntax in XAML should only be supported when setting property values using property element syntax and not attribute syntax.
Adds a property to
XamlAstXamlPropertyValueNode
to indicate whether the property value came from an attribute, and a property toPropertySetterBinderParameters
to indicate whether a setter can be used from an attribute.The
AdderSetter
s setPropertySetterBinderParameters.AllowAttributeSyntax
to false, which disallows their usage from attributeXamlAstXamlPropertyValueNode
s.Updated the unit tests to ensure that markup extensions cannot now be used to add items to read-only collections (but can be used to assign lists to read-write collection properties).
Required for https://github.com/AvaloniaUI/Avalonia/issues/10946