summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2563.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2563.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2563.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2563.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2563.cs
new file mode 100644
index 00000000..538d1553
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue2563.cs
@@ -0,0 +1,41 @@
+using System;
+using Xamarin.Forms.CustomAttributes;
+
+namespace Xamarin.Forms.Controls
+{
+ [Preserve (AllMembers=true)]
+ [Issue (IssueTracker.Github, 2563, "NavigationPage should support queuing of navigation events", PlatformAffected.Android | PlatformAffected.WinPhone | PlatformAffected.iOS)]
+ public class Issue2563 : ContentPage
+ {
+ public Issue2563 ()
+ {
+ var button = new Button {
+ Text = "Click Me",
+ VerticalOptions = LayoutOptions.Center,
+ HorizontalOptions = LayoutOptions.Center
+ };
+
+ Content = button;
+
+ var random = new Random ();
+ button.Clicked += (sender, args) => {
+ for (int i = 0; i < 10; i++) {
+ button.Navigation.PushAsync (new ContentPage {
+ Title = "Page " + i,
+ Content = new Label {
+ Text = "Page " + i,
+ XAlign = TextAlignment.Center,
+ YAlign = TextAlignment.Center
+ }
+ }, random.NextDouble () > 0.5);
+ }
+
+ for (int i = 0; i < 6; i++) {
+ button.Navigation.PopAsync (random.NextDouble () > 0.5);
+ }
+
+ button.Navigation.PopToRootAsync (random.NextDouble () > 0.5);
+ };
+ }
+ }
+} \ No newline at end of file