summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/NavReproApp.cs
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@gmail.com>2016-03-29 14:08:26 -0600
committerE.Z. Hart <hartez@gmail.com>2016-03-29 14:08:26 -0600
commit81cb1d36479ec7d889fade1d53bef34357a73fb9 (patch)
tree061db1acff6446c4a7fce242c4231bb6e19e5a8a /Xamarin.Forms.Controls/NavReproApp.cs
parent57b0f3ab3080928d2ddd2da58fc84ef7023c3651 (diff)
downloadxamarin-forms-81cb1d36479ec7d889fade1d53bef34357a73fb9.tar.gz
xamarin-forms-81cb1d36479ec7d889fade1d53bef34357a73fb9.tar.bz2
xamarin-forms-81cb1d36479ec7d889fade1d53bef34357a73fb9.zip
Make ControlGallery App.cs conform to code style
Diffstat (limited to 'Xamarin.Forms.Controls/NavReproApp.cs')
-rw-r--r--Xamarin.Forms.Controls/NavReproApp.cs66
1 files changed, 66 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/NavReproApp.cs b/Xamarin.Forms.Controls/NavReproApp.cs
new file mode 100644
index 00000000..1c55d0b1
--- /dev/null
+++ b/Xamarin.Forms.Controls/NavReproApp.cs
@@ -0,0 +1,66 @@
+using System;
+
+namespace Xamarin.Forms.Controls
+{
+ // Not quite sure how to turn this into a test case, effectively replace the normal Application with this to repro issues reported.
+ // Full repro requires assignment to MainPage, hence the issue
+ public class NavReproApp : Application
+ {
+ NavigationPage navPage1 = new NavigationPage ();
+
+ public NavReproApp ()
+ {
+
+ var btn = new Button () { Text = "Start" };
+
+ btn.Clicked += Btn_Clicked;
+
+ navPage1.PushAsync (new ContentPage () { Content = btn });
+
+ MainPage = navPage1;
+
+ }
+
+ async void Btn_Clicked (object sender, EventArgs e)
+ {
+ await navPage1.PushAsync (new ContentPage () { Content = new Label () { Text = "Page 2" } });
+ await navPage1.PushAsync (new ContentPage () { Content = new Label () { Text = "Page 3" } });
+
+
+ var navPage2 = new NavigationPage ();
+
+ var btn = new Button () { Text = "Start Next" };
+ btn.Clicked += Btn_Clicked1;
+
+ await navPage2.PushAsync (new ContentPage () { Content = btn });
+
+ MainPage = navPage2;
+
+
+ }
+
+ async void Btn_Clicked1 (object sender, EventArgs e)
+ {
+ MainPage = navPage1;
+ await navPage1.PopAsync ();
+
+
+ await navPage1.PushAsync (new ContentPage () { Content = new Label () { Text = "Page 3a" } });
+ }
+
+ protected override void OnStart ()
+ {
+ // Handle when your app starts
+ }
+
+ protected override void OnSleep ()
+ {
+ // Handle when your app sleeps
+ }
+
+ protected override void OnResume ()
+ {
+ // Handle when your app resumes
+ }
+ }
+} \ No newline at end of file