Describe the bug
#10827 made ItemsControl.Items readonly, however as reported in that PR, there are no indications at compile time that this is no longer supported. Instead the XAML compiler adds a Binding object to the ItemsCollection.

I think this is because the XAML compiler is treating the following two XAML snippets as equivalent:
<ItemsControl Items="{Binding Foo}"/>
<ItemsControl>
<ItemsControl.Items>
<Binding Path="Foo"/>
</ItemsControl.Items>
</ItemsControl>
And so is creating a Binding object and adding it to Items with Items.Add(object?).
WPF does not behave in the same way: trying to assign a binding to ItemsControl.Items gives us:
The property "Items" does not have an accessible setter.
Desktop (please complete the following information):
Describe the bug
#10827 made
ItemsControl.Itemsreadonly, however as reported in that PR, there are no indications at compile time that this is no longer supported. Instead the XAML compiler adds aBindingobject to theItemsCollection.I think this is because the XAML compiler is treating the following two XAML snippets as equivalent:
And so is creating a
Bindingobject and adding it toItemswithItems.Add(object?).WPF does not behave in the same way: trying to assign a binding to
ItemsControl.Itemsgives us:Desktop (please complete the following information):
master