summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla43469.cs
blob: b81f98e373e5637edf4f6fcbc3fdbaeaa9c0e9c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using System;
using System.Threading.Tasks;

#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif

namespace Xamarin.Forms.Controls
{
	[Preserve(AllMembers = true)]
	[Issue(IssueTracker.Bugzilla, 43469, "Calling DisplayAlert twice in WinRT causes a crash", PlatformAffected.WinRT)]
	public class Bugzilla43469 : TestContentPage
	{
		protected override void Init()
		{
			var button = new Button { Text = "Click to call DisplayAlert twice" };

			button.Clicked += (sender, args) =>
			{
				Device.BeginInvokeOnMainThread(new Action(async () =>
				{
					await DisplayAlert("First", "Text", "Cancel");
				}));

				Device.BeginInvokeOnMainThread(new Action(async () =>
				{
					await DisplayAlert("Second", "Text", "Cancel");
				}));
			};

			Content = button;
		}
	}
}