microsoft / microsoft/microsoft-ui-xaml
App crashes when resizing window to small size with PipsPager inside Viewbox
- Dominant language
- C++
- Stars
- 8.4k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 105
Description
### Describe the bug
The WinUI 3 application crashes with an unhandled ArgumentException when dynamically resizing the application window to a small size. The crash only occurs when a PipsPager control is nested inside a Viewbox.
The application runs normally at normal window size on startup. However, while dragging the window border to shrink the window to a relatively small size, the layout recalculation triggered by window resize causes an internal layout exception in PipsPager.MeasureOverride, resulting in a full app crash.
### Why is this important?
This will just make the app crash.
### Steps to reproduce the bug
1. Create a new WinUI 3 packaged project (Windows App SDK).
2. Add a Viewbox containing a standard PipsPager control in XAML.
3. Build and run the application; the UI loads normally without any startup crash.
4. Drag the window border to manually shrink the window to a small size.
5. The application crashes immediately during the window layout update.
### Actual behavior
_No response_
### Expected behavior
_No response_
### Screenshots
_No response_
### NuGet package version
AppSDK: 2.1.3
### Windows version
Windows 11 (25H2): Build 26200
### Additional context
**// Give this a try, it easily reproduces the problem.**
Contributor guide
Research direction
Start by reproducing the crash with the provided Window XAML, especially the Viewbox and PipsPager combination, while resizing the window. Inspect PipsPager.MeasureOverride and the layout path reached during resizing. Done means the sample can be resized to a small window without an unhandled ArgumentException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100