Why does navigation stop working in .Net Maui
22:26 25 Feb 2023

I am having this problem where my navigation just seems to stop working in my Maui app. I generally use:

Shell.Current.GoToAsync(route);

to go between pages.

But every now and then it just stops working. Most of the time there are no error messages or any exceptions being thrown, but sometimes I do get strange exceptions.

Also, I have one page in particular which I get stuck on every time I navigate to it. I just can't seem to navigate anywhere from it. I tried using ".." as the route but that doesn't work either.

I just have the feeling I am missing something.

My app is probably a bit too complex to upload a working example, but the shell looks like below. The page I have trouble with is the SelectorPage. I navigate to it using:

Shell.Current.GoToAsync("SelectorPage");

then on that page I try to navigate back using these:

Shell.Current.GoToAsync("LoginPage");
Shell.Current.GoToAsync("..");

but nothing happens. Putting a breakpoint on the code shows me the code is executed.

Any thoughts?



  

    
        
    

    

         
        

        
        
            
            
        

    

    
        
    




EDIT: I have a working example here if anyone cares to have a look: https://pdscode.com.au/wp-content/uploads/2023/02/MauiApp3.zip

I can't reproduce the exact problem in this but I do see glitches. The app has 16 'wizard' pages. After that you go to a login page which takes you to the main app. From the burger menu you can choose Reset to go back to the start. I notice that stops working after you go through a couple of times. However, hopefully someone will be able to look and tell me if I have done something terribly wrong!

Thanks

c# maui