- Run resize logic if `Width`/`Height` are still NaN (i.e. not set up)
- Always call base class `WindowBase.HandleResize`
- In `WindowBase.HandleResize` don't run a layout pass if client size unchanged
Fixes `Width_Height_Should_Not_Be_NaN_After_Show_With_SizeToContent_Manual`.
When showing a child window with `WindowStartupLocation = CenterOwner` to a minimized owner window, we were displaying the child in an invalid position. Use the WPF behavior of falling back to `CenterScreen` in this situation.
Fixes#7582
The validating layer introduced in #7369 has done its job and caught a few bugs, but was causing difficulties in certain places so removing it now.
Fixes#7573
- 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`
- Allow nested calls to `BeginAutoSizing` - previously it was called twice when showing a window on a secondary monitor and when the second `using` block exited it cleared the autosizing state despite the outer block not completing
- Call `SetWindowStartupLocation` within the auto-sizing block. Moving to a secondary monitor causes a resize message.