0
votes

I am developing an application for Android and iOS with Xamarin Forms. So, when I open a new page I do it in the following way:

var newPage = new ContentPage (); await Navigation.PushAsync (newPage);

My question is: When you press the Back Button (either the physical button on the device or the one on the navigation bar) the page completely removed from navigation? Or what about the page?

1
actually will remove from the stack and compiler will call the following method : protected override bool OnBackButtonPressed()Mohamad Mahmoud
Thanks for your comment, do you know if there is any way to close the page completely? Without there being any registry in cache?Adán Amolitos

1 Answers

1
votes

When you use await Navigation.PushAsync (newPage) you are inserting newPage into the top of the NavigationStack. If you press the Back Button the system will do the reverse: Navigation.PopAsync(). Your page will be dismissed from the NavigationStack but the Page object will remain the same.