I have problem for Navigation in my app. I use xamarin.forms how can clean my navigation stack. No use Pop and push. Can I see my full navigation stack ?
This is a function I made to empty the stack and navigate to a specified page. (The use case was the app was de-activated during use and I need to kick the user out)
public async Task PopAllTo(ViewModel vm)
{
if (vm == null) return;
Page page = PreparePage(vm); //replace 'page' with the page you want to reset to
if (page == null) return;
_navigation.InsertPageBefore(page, _navigation.NavigationStack.First());
await _navigation.PopToRootAsync();
}