diff --git a/src/Uno.UWP/UI/Popups/MessageDialog.iOS.cs b/src/Uno.UWP/UI/Popups/MessageDialog.iOS.cs index fdf2e179a7e1..bcaed3375400 100644 --- a/src/Uno.UWP/UI/Popups/MessageDialog.iOS.cs +++ b/src/Uno.UWP/UI/Popups/MessageDialog.iOS.cs @@ -48,13 +48,13 @@ private async Task ShowInner(CancellationToken ct) { alertController.PreferredAction = alertActions.ElementAtOrDefault((int)DefaultCommandIndex); } - + using (ct.Register(() => { // If the cancellation token itself gets cancelled, we cancel as well. result.TrySetCanceled(); UIApplication.SharedApplication.KeyWindow?.RootViewController?.DismissViewController(false, () => { }); - })) + }, useSynchronizationContext: true)) { await _viewControllerAccess.WaitAsync(ct);