I have a .Net Maui 7 app. When a certain modal page is open, I need to open a new modal page and close the previous one. I have tried the following code but it’s not working :
Navigation.RemovePage(Navigation.ModalStack.Last()); // Remove the current page from the stack
await Navigation.PushModalAsync(TheNewPage, false); // Open the new modal page
What’s happening is that the line **Navigation.RemovePage** doesn’t remove the modal page from the stack. For some reasons out of this topic, I can not use Shell navigation. Does anyone know how to solve that please ?
New contributor
H4D35 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.