TabControl tabControl = new();
tabControl.Items.Add(new TabItem("Tab Item"));
tabControl.Items.Clear();
// tabControl.Items.RemoveAt(0); exhibits the same behavior
The setter on ListButton.IsPressed will throw when accessing Parent on line 20, which will be null at this point.
I believe the TabItem's Selector will have a Grid InternalChild, whose WidgetsOnCollectionChanged method will unset the Parent property.
To reproduce:
The setter on ListButton.IsPressed will throw when accessing Parent on line 20, which will be null at this point. I believe the TabItem's Selector will have a Grid InternalChild, whose WidgetsOnCollectionChanged method will unset the Parent property.