my current navigation stack has two pages. First is page A, second is Page B. When I click my button, It'll add a new page to the navigation stack, Page C.
May I ask how do I display Page C and remove Page B, or remove page B and display page C.
I've tried the following
await Navigation.PopAsync()
await Navigation.PushAsync(new CustomPage())
The issue i'm having with this is that the page pops successfully, but the new page isn't visible. I immediately see page A. May I ask how do I pop the current page and immediately show another.
Instead of popping the page and then trying to push the new page. I would push your new page then remove the previous page from the NavigationStack
.
var previousPage = Navigation.NavigationStack.LastOrDefault();
await Navigation.PushAsync(new CustomPage());
Navigation.RemovePage(previousPage);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With