maui-linux/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issu.../Bugzilla38105.cs

64 строки
1.6 KiB
C#
Исходник Обычный вид История

2018-10-01 20:19:51 +03:00
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
2016-03-22 23:02:25 +03:00
2018-10-01 20:19:51 +03:00
namespace Xamarin.Forms.Controls.Issues
2016-03-22 23:02:25 +03:00
{
[Preserve (AllMembers = true)]
2018-10-01 20:19:51 +03:00
[Issue (IssueTracker.Bugzilla, 38105, "RemovePage does not cause back arrow to go away on Android", PlatformAffected.Android, navigationBehavior: NavigationBehavior.PushModalAsync)]
public class Bugzilla38105 : TestMasterDetailPage
2016-03-22 23:02:25 +03:00
{
protected override void Init ()
{
2018-10-01 20:19:51 +03:00
Detail = new NavigationPage (new ViewA38105 ());
2016-03-22 23:02:25 +03:00
var button = new Button () { Text = "Click me" };
button.Clicked += (o, e) => {
var navPage = (NavigationPage)Detail;
var rootPage = navPage.CurrentPage;
navPage.PopToRootAsync (false);
2018-10-01 20:19:51 +03:00
navPage.Navigation.PushAsync (new ViewB38105 ());
2016-03-22 23:02:25 +03:00
navPage.Navigation.RemovePage (rootPage);
IsPresented = false;
};
Master = new ContentPage () {
Title = "test",
Content = button
};
}
2018-10-01 20:19:51 +03:00
[Preserve(AllMembers = true)]
class ViewA38105 : ContentPage
2016-03-22 23:02:25 +03:00
{
2018-10-01 20:19:51 +03:00
public ViewA38105 ()
2016-03-22 23:02:25 +03:00
{
Title = "View A";
2018-10-01 20:19:51 +03:00
Content = new Label
{
Text = "Verify that the page title is currently \"View A\". Open master detail menu and click the content button. " +
"Verify that the page title is now \"View B\" and that the hamburger icon is NOT replaced by the back arrow.",
HorizontalTextAlignment = TextAlignment.Center,
VerticalTextAlignment = TextAlignment.Center,
LineBreakMode = LineBreakMode.WordWrap,
MaxLines = 5
};
2016-03-22 23:02:25 +03:00
}
}
2018-10-01 20:19:51 +03:00
[Preserve(AllMembers = true)]
class ViewB38105 : ContentPage
2016-03-22 23:02:25 +03:00
{
2018-10-01 20:19:51 +03:00
public ViewB38105 ()
2016-03-22 23:02:25 +03:00
{
Title = "View B";
}
}
}
}