Hello,
How to clear the previously opened pages in MAUI App Shell?
You can get the Shell's Navigation stack, then remove all of them one by one like following code.
var stack = Shell.Current.Navigation.NavigationStack.ToArray();
for(int i = stack.Length - 1; i > 0; i--)
{
Shell.Current.Navigation.RemovePage(stack[i]);
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.