RadekVyM/SimpleToolkit

How to navigate from tap gesture?

raselldev opened this issue · 3 comments

i have .xaml like this:

  <Label.GestureRecognizers>
      <TapGestureRecognizer
          x:Name="tapInbox"
          Tapped="tapInbox_Tapped"
          NumberOfTapsRequired="1"/>
  </Label.GestureRecognizers>
    void tapInbox_Tapped(System.Object sender, Microsoft.Maui.Controls.TappedEventArgs e)
    {
        this.GoToAsync($"///{PageType.InboxPage}", true);
    }

and i register route like this:

Routing.RegisterRoute(nameof(PageType.InboxPage), typeof(InboxPage));

i need help because i don't know how to fix this

Please read this issue @RadekVyM

Hi @raselldev,

in SimpleShell, navigation works (almost) exactly the same as in the original .NET MAUI Shell. Detail pages (pages registered using the RegisterRoute() method) cannot be the only pages on the navigation stack. See documentation for more info.

For detail pages, try to use something like this instead:

this.GoToAsync($"{PageType.InboxPage}", true);

It's works! Thanks