- Allow nested calls to `BeginAutoSizing` - previously it was called twice when showing a window on a secondary monitor and when the second `using` block exited it cleared the autosizing state despite the outer block not completing
- Call `SetWindowStartupLocation` within the auto-sizing block. Moving to a secondary monitor causes a resize message.
`DirectProperty` stored a `EnabledDataValidation` flag in its metadata but also had an `IsDataValidationEnabled` property in `DirectPropertyBase` which was the one used by `AvaloniaObject`. Use the version from metadata so that it can be overridden and remove the flag from `DirectPropertyBase`.
Just need to call `BindingValue<T>.FromUntyped` instead of doing a conditional, because otherwise we run the risk of passing `UnsetValue` to the `BindingValue<T>` ctor which will throw in that case.
If the `SelectionModel` passed to `SelectedItemsSync` has not yet had a `Source` assigned, set a flag to write the selected items to the `SelectionModel` when `Source` is set.
Fixes#4272
The grid hack was initiated when attached to the visual tree but the dispose had been placed in `OnDetachedFromLogicalTree` by mistake. Place it in `OnDetachedFromVisualTree`.
It can mean that `Count` is out-of-date with regards to the inner collection if it's accessed in a collection changed handler before `OnItemsSourceChanged` is fired.
It's never been clear to me why ItemsSourceView caches the size; I suspect it's due to the performance characteristics of WinRT and so I think it can be safely removed in Avalonia.
Fixes#4409