- Adds a "resize reason" to platform `Resized` events
- Which is used by the auto-sizing code to determine whether to reset `SizeToContent`
- Also other improvements to the reset logic for `SizeToContent`:
- Don't reset it if the size hasn't changed
- Don't reset it if `CanResize == false`
- Only reset the dimensions whose size has changed
- Obsolete the `BeginAutoSizing`/`AutoSizing` feature in `WindowBase`
- When detaching set `Parent` to `null` before raising the `DetachedFromLogicalTree` event
- To do this, we need to store the logical root in the control so that e.g. a child control can be detached in a `DetachedFromLogicalTree` handler
- Add `Source` and `Parent` properties to `LogicalTreeAttachmentEventArgs` to give more context on what caused the attachment/detachment
- Added `IInputRoot Root` property to `RawInputEventArgs`
- Removed `InputRoot` and `Root` properties from `RawDragEvent` and `RawPointerEvent` as its now in the base class
- `InputRoot` in `RawDragEvent` was incorrectly using the type `IInputElement` instead of `IInputRoot`, fix callers that were using the wrong type
- Pass the input root to all raw input event constructors
- If no control is focused in `KeyboardDevice.ProcessRawEvent` then raise the event on the 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.
Also made a few other changes along the way:
- Add MaxClientSize to ILayoutRoot
- Store IRenderRoot in Visual and use that to calculate
IsAttachedToVisualTree
- Make Affects* methods take multiple properties
...during ApplyTemplate. This was so that ItemsControls could their find
ItemsPresenters nested in other templated controls. Instead use
IItemsPresenterHost to make the presenter register itself with its
TemplatedParent.