Skip to content

Commit 145e00b

Browse files
committed
Update Issues16321.xaml.cs
1 parent 7c22523 commit 145e00b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Controls/tests/TestCases.HostApp/Issues/Issues16321.xaml.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,19 @@ async void OpenActionSheetWithModals(System.Object sender, System.EventArgs e)
4646

4747
async void OpenPrompt(System.Object sender, System.EventArgs e, Func<Page, Task> promptAction)
4848
{
49-
var uIWindow = new UIWindow();
5049
var keyWindow = (this.Window.Handler.PlatformView as UIWindow);
50+
51+
UIWindow uIWindow;
52+
if (OperatingSystem.IsIOSVersionAtLeast(13) && keyWindow?.WindowScene is not null)
53+
{
54+
uIWindow = new UIWindow(keyWindow.WindowScene);
55+
}
56+
else
57+
{
58+
#pragma warning disable CA1422 // This call site is reachable on iOS < 13.0
59+
uIWindow = new UIWindow();
60+
#pragma warning restore CA1422
61+
}
5162
if (keyWindow?.WindowLevel == UIWindowLevel.Normal)
5263
keyWindow.WindowLevel = -1;
5364

0 commit comments

Comments
 (0)