Force Shell navigation to replace the navigation stack

Petr Pikaus 10 Reputation points
2023-05-23T16:22:09.9133333+00:00

I have a ShellContent which uses DataTemplateSelector to dynamically select a page to display. Sadly, when I call Shell.Current.GoToAsync with the URI that's active right now (or its child route), it does nothing (or navigates back in the case of the child route) there's no parameter to control this behavior that I'm aware of. Based on the documentation, navigating to //some-uri should replace the navigation stack, but that does not happen.

Developer technologies | .NET | .NET MAUI
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.