A few `AutoScrollToSelectedItem` improvements:
- Scroll to current selected item when it's set to true
- Scroll to current selected item when list first displayed
- Scroll to current selected item when attached to visual tree if the selection was changed while it wasn't attached
Fixes#4100
- Remove `SelectedItemsSync` and store `SelectedItems` in a new `InternalSelectionModel`
- Store transient `SelectingItemsControl` state in an `UpdateState` object
Fixes#4272
As described in #3437 the argument ordering was different to WPF/UWP causing bugs in some code ported from WPF/UWP. Use the same argument ordering as WPF/UWP.
Fixes#3437
As described in #3437 the argument ordering was different to WPF/UWP causing bugs in some code ported from WPF/UWP. Use the same argument ordering as WPF/UWP.
Fixes#3437
Having a separate subscription to `Items.CollectionChanged` in both `ItemsControl` and `ItemsPresenter` meant that the `ItemsPresenter` sometimes doesn't update itself in time for a selection change, resulting in #3148. Make `ItemsControl` trigger `ItemsPresenter.ItemsChanged` rather than both controls listening to the event separately.
Fixes#2901. Two things needed to be done here:
- When an item is removed, causing indexes to be reassigned, raise `Recycled` so that `SelectingItemsControl` knows to update the selection state
- Update selection state in `SelectingItemsControl` when the selected item changes, but the selected index does not (due to an item being remove)
- Allow `SelectAll` regardless of `SelectionMode`: `SelectionMode` should only apply to user-interaction
- Don't select multiple on shift/ctrl-right click