For non-logical scrolling:
- Use 16 for small scroll size (value taken from WPF)
- Use viewport size for large scroll
For logical scrolling, use the `ScrollSize`/`PageScrollSize` defined on `ILogicalScrollable`. Note that this required a small breaking change to `ILogicalScrollable`.
Fixed#3245
The root of our logical tree is denoted by `IStyleRoot` for historical reasons: before #1594, styling was defined in `Avalonia.Styling` but the logical tree was defined in `Avalonia.Controls`. The styling system needed a root but because it was lower-level than the logical tree it had to define its own root type which was then repurposed for use by the logical tree.
Since #1594 the logical tree is defined in `Avalonia.Styling` as well so we might as well call `IStyleRoot` what it is: the logical tree root.
And implement the functionality in the content controls themselves. `ContentControlMixin` was too complex and even with its complexity had bugs (such as in #2821). By moving the functionality to the content controls there is some repeated code but it's much more straightforward.
Previously a dangling reference to `ContentPresenter` was left in place in the ex-child control's `InheritanceParent`. When the child is removed from the `ContentPresenter`, reset the value to the control's logical parent.
- Share common layout logic between `Border`, `ContentPresenter` and `ScrollContentPresenter`
- Added a bunch of tests for things not previously convered
- Fix `ScrollContentPresenter` child layout
Added an `IDataTemplateHost` interface with a `IsDataTemplatesInitialized` property to prevent the need for allocating empty `DataTemplates` collections for many controls.
There were two problems:
- There were two root controls (`TestScroller` and `TestRoot`)
- The root control needs to have a fixed size otherwise it will grow because `LayoutManager` passes `MaxClientSize` to its measure (which may be different to the initial measure that we were using to set its size).