blob: 476a611b1fc8b4d96bdc2d2ecf4ea0cb4686de8e (
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
38
39
40
41
42
43
44
45
46
47
|
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.Controls
{
[Preserve (AllMembers=true)]
[Issue (IssueTracker.Github, 1329, "Losing root page with rapidly pushing and popping", PlatformAffected.Android)]
public class Issue1329 : NavigationPage
{
public Issue1329 () : base (GetPage ("root page"))
{
var navigation = new NavigationPage (GetPage ("root page"));
var pageNum = 0;
MessagingCenter.Subscribe<Button> (
navigation,
"PushPage",
(sender) => navigation.PushAsync (GetPage ("Page #: " + ++pageNum))
);
navigation.Popped += (sender, e) => {
pageNum -= 1;
};
}
public static Page GetPage (string name) {
var button = new Button {
Text = name
};
button.Clicked += (sender, e) => MessagingCenter.Send<Button> ((Button)sender, "PushPage");
var page = new ContentPage {
Content = button
};
return page;
}
}
}
|