I have a xamarin.forms app which has several screens. The navigation of my pages is like this.
1 --> 2 --> 3 --> 4 --> 5 --> 6
The 6th page is popup created using Rg.plugin.popup.User can navigate to and forth as many times in this hierarchy. But when they reach 6th page there is a button. In the button click it should navigate user to 2nd page. How can I remove all the pages ie; 3,4,5 from stack and go to 2nd page.
What I tried
on button click :
for (var i = 1; i < countPagesToRemove; i++)
{
Navigation.RemovePage(Navigation.NavigationStack[Navigation.NavigationStack.Count - 2]);
}
await Navigation.PopAsync();
This link ask same question but it doesn't work for me.
Then I tried like this
await PopupNavigation.Instance.PopAsync();
Application.Current.MainPage = new NavigationPage(new NCDashboard());
It will navigate to 2nd page but will not show back button to first page due to nothing in the stack. So how can I solve this problem? Any help is appreciated.

Navigation.PushAsync. I would do some test withRg.plugin.popupand feedback ASAP. - Wendy Zang - MSFT