.NET Maui Shell Navigation - Navigate to Login Page without the possibility to get back

695 views Asked by At

after the App is starting im on my InitPage, in there i want to go to another Page if some value is getting checked, i want to navigate to my LoginPage if not Tokens etc. are found with Shell.GoToAsync("//LoginView"); if i try to do that im getting the exception: Global routes cannot be the only page on the stack,... so if i just navigate to ("LoginView") im getting the possibility to go back, which i dont want!

the funny thing is that my app worked before a week with this shell, what did i do :D

  • heres my AppShell.xaml:
<FlyoutItem Title="Initialization">
        <ShellContent ContentTemplate="{DataTemplate views:InitView}" Route="InitView"/>
    </FlyoutItem>

    <FlyoutItem Title="Login">
        <ShellContent ContentTemplate="{DataTemplate views:LoginView}"
                      Route="LoginView"/>
    </FlyoutItem>

    <FlyoutItem Title="Notifications">
        <ShellContent ContentTemplate="{DataTemplate views:NotificationView}" Route="NotificationView"/>
    </FlyoutItem>

-heres my AppShell.xaml.cs

Routing.RegisterRoute(nameof(InitView), typeof(InitView));
        Routing.RegisterRoute(nameof(LoginView), typeof(LoginView));
        Routing.RegisterRoute(nameof(NotificationView), typeof(NotificationView));

So what Point did i miss here? I really can't get any further :(

Tryied to navigate to a page with // prefix for getting no back availablity dont work

0

There are 0 answers