Fix potential crash when more than two alerts are requested.
This commit is contained in:
Родитель
2f22897900
Коммит
e7582e0bc6
|
@ -16,7 +16,7 @@ namespace Xamarin.Forms.Controls
|
|||
{
|
||||
protected override void Init()
|
||||
{
|
||||
var button = new Button { Text = "Click to call DisplayAlert twice" };
|
||||
var button = new Button { Text = "Click to call DisplayAlert three times" };
|
||||
|
||||
button.Clicked += (sender, args) =>
|
||||
{
|
||||
|
@ -29,6 +29,11 @@ namespace Xamarin.Forms.Controls
|
|||
{
|
||||
await DisplayAlert("Second", "Text", "Cancel");
|
||||
}));
|
||||
|
||||
Device.BeginInvokeOnMainThread(new Action(async () =>
|
||||
{
|
||||
await DisplayAlert("Three", "Text", "Cancel");
|
||||
}));
|
||||
};
|
||||
|
||||
Content = button;
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace Xamarin.Forms.Platform.UWP
|
|||
if (options.Accept != null)
|
||||
alertDialog.PrimaryButtonText = options.Accept;
|
||||
|
||||
if (s_currentAlert != null)
|
||||
while (s_currentAlert != null)
|
||||
{
|
||||
await s_currentAlert;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче