RadekVyM / SimpleToolkit

SimpleToolkit is a .NET MAUI library of helpers and simple, fully customizable controls, such as SimpleShell - custom Shell implementation that allows you to create unique navigation experiences.
MIT License
434 stars 44 forks source link

How to navigate from tap gesture? #30

Closed raselldev closed 1 year ago

raselldev commented 1 year ago

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

raselldev commented 1 year ago

Please read this issue @RadekVyM

RadekVyM commented 1 year ago

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);
raselldev commented 1 year ago

It's works! Thanks