Allow overriding the default behavior of item containers in styles or in `ItemContainerTheme`. To do this, use `SetCurrentValue` to set the properties, only if the properties are not already set (i.e. from a style). This also requires us to clear the current value when the container is cleared (styles won't be affected as `AvaloniaObject.ClearValue` only clears local or `SetCurrentValue` values).
Makes the `StyledElement.Classes` and `Flyout.FlyoutPresenterClasses` properties readonly. Adds a transformer to the XAML compiler to convert attribute syntax classes setters to collection syntax so that they will be added to the existing `Classes` object.
Prevents an unneeded allocation of a `Classes` object when setting `Classes` from XAML.
Rather than using the `ISelectable` interface to communicate container selection from the `SelectingItemsControl` to the container, use the `SelectingItemsControl.IsSelected` attached property, setting it with `SetCurrentValue` so that bindings defined in a style or item container theme can override the selection. Required an extra virtual `ContainerForItemPreparedOverride` method on `ItemsControl`.
The real Windows Maximize button has no automation ID and is localized. Get it by index instead of by name. The Avalonia one isn't localized so we can get it by name.
- `MenuItem` is a `HeaderedSelectingItemsControl` not a `HeaderedItemsControl` so need to separate logic for that case when preparing items
- Added `HeaderTemplate` to `HeaderedSelectingItemsControl `
- Tweaked logic for selecting header templates: parent's `ItemTemplate` should be used if set (cross-checked with WPF)
- Update menu templates to bind to menu item's `HeaderTemplate`
Fixes#10626Fixes#10718