microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

ContentDialog resize and reposition issues with XAML Islands

Open aquinn39 opened this issue 2 years ago • 5 comments

Describe the bug

When using XAML Islands, ContentDialogs do not handle window size changes very well. This isn't a very good user experience. From my testing, ContentDialogs created programatically do not reposition at all when the window size is changed, also the darkened background that shows over the UI when a ContentDialog present does not resize. When a ContentDialog is defined in XAML, however, the dialog does reposition but the darkened background still does not resize. This issue does not seem to affect UWP apps.

Steps to reproduce the bug

  1. Create an app that uses WinUI 2 with XAML Islands (Tutorial here: https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/host-standard-control-with-xaml-islands).
  2. Create a ContentDialog in XAML and show it.
  3. Create a ContentDialog programatically, set the XAMLRoot to the one where you want to show it and show it.

Expected behavior

The ContentDialog should always be in the centre of the XAML Island and the smoke should always cover the whole Island.

Screenshots

ContentDialog created programatically:

https://user-images.githubusercontent.com/43898231/180009852-f55b005e-9250-4463-b257-4507ca846cec.mp4

ContentDialog created in XAML:

https://user-images.githubusercontent.com/43898231/180010127-abbbdcce-5a03-4c97-a8da-fe2e74655f2b.mp4

NuGet package version

Microsoft.UI.Xaml 2.8.0

Windows app type

  • [ ] UWP
  • [ ] Win32

Device form factor

Desktop

Windows version

Windows 11 (21H2): Build 22000

Additional context

No response

aquinn39 avatar Jul 20 '22 14:07 aquinn39