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).
`VisualBrush`es need to get delegated back to the renderer for
rendering, so added an `IVisualBrushRenderer` interface which is
implemented by the renderers, and pass this when creating drawing
contexts. Only currently implemented/tested for D2D and
`ImmediateRenderer`.
There are still a few bugs around scrollbar behavior, and maybe Grid. To
see them, add a long item in the middle of VirtualizationTest's items,
resize the window to require a scrollbar and scroll up and down.
Rather than repainting whenever, this adds a render loop which is called
N times per second. IRenderQueueManager and ITopLevelRenderer have been
removed, replaced by IRenderer.