0

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

Pascal
  • 79
  • 1
  • 5
  • [My solution](https://stackoverflow.com/a/74279871/199364) is to remove LoginPage from Shell. In your case, also remove InitView. The concept is to do one-time work BEFORE launching Shell. An alternative is [Sir Rufo’s](https://stackoverflow.com/a/76263966/199364). This is a sophisticated use of services. Maybe more than you want to learn now, but worth keeping in mind. – ToolmakerSteve May 17 '23 at 16:30

0 Answers0