summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32615.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32615.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32615.cs70
1 files changed, 70 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32615.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32615.cs
new file mode 100644
index 00000000..405133e0
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla32615.cs
@@ -0,0 +1,70 @@
+´╗┐using System;
+
+using Xamarin.Forms.CustomAttributes;
+using System.Threading.Tasks;
+
+#if UITEST
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls
+{
+ [Preserve (AllMembers = true)]
+ [Issue (IssueTracker.Bugzilla, 32615, "OnAppearing is not called on previous page when modal page is popped")]
+ public class Bugzilla32615 : TestContentPage // or TestMasterDetailPage, etc ...
+ {
+ int _counter;
+ Label _textField;
+ protected override void Init ()
+ {
+ var btnModal = new Button { AutomationId = "btnModal", Text = "open", HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand };
+ btnModal.Clicked += async (sender, e) => await Navigation.PushModalAsync (new Bugzilla32615Page2 ());
+ _textField = new Label { AutomationId = "lblCount"};
+ var layout = new StackLayout ();
+ layout.Children.Add (btnModal);
+ layout.Children.Add (_textField);
+ // Initialize ui here instead of ctor
+ Content = layout;
+ }
+
+ protected override void OnAppearing()
+ {
+ _textField.Text = _counter++.ToString();
+ }
+
+ class Bugzilla32615Page2 : ContentPage
+ {
+ public Bugzilla32615Page2 ()
+ {
+ var btnPop = new Button { AutomationId = "btnPop", Text = "pop", HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand };
+ btnPop.Clicked += async (sender, e) => await Navigation.PopModalAsync ();
+ Content = btnPop;
+ }
+
+ protected override void OnDisappearing ()
+ {
+ System.Diagnostics.Debug.WriteLine ("Disappearing Modal");
+ base.OnDisappearing ();
+ }
+
+ protected override void OnAppearing ()
+ {
+ System.Diagnostics.Debug.WriteLine ("Appearing Modal");
+ base.OnAppearing ();
+ }
+ }
+
+#if UITEST
+ [Test]
+ public async void Bugzilla32615Test ()
+ {
+ RunningApp.Tap (q => q.Marked ("btnModal"));
+ RunningApp.Tap (q => q.Marked ("btnPop"));
+ await Task.Delay (1000);
+ var lbl = RunningApp.WaitForElement (c => c.Marked("lblCount"));
+ Assert.AreEqual ("1", lbl [0].Text);
+ }
+#endif
+ }
+}