Shell Navigation

Hikari91Hikari91 ITMember ✭✭✭
edited August 2 in Xamarin.Forms

Hi all,
I have a Shell application with TabBar.
Some route have been configured like this:

<Tab Route="nuovoOrario" Title="MyTitle" Icon="orari.png">
    <ShellContent ContentTemplate="{DataTemplate views:InserimentoOrariPage}" />
</Tab>

Some other routes have been configured like this:
Routing.RegisterRoute("MappaWo", typeof(MappaWoPage));

I need to navigate to this page passing some parameters.
Shell.Current.GoToAsync($"//MappaWo?latitudine={sender.Latitudine}&longitudine={sender.Longitudine}")

If I try to navigate to nuovoOrario all works fine, but if I try to do the same thing to MappaWo nothing happens.

Both pages have QueryProperty attribute (the MappaWo page have two of these).

This is a Page sample:

namespace SgatFAST.Views
{
    [XamlCompilation(XamlCompilationOptions.Compile), QueryProperty("Latitudine", "latitudine"), QueryProperty("Longitudine", "longitudine")]
    public partial class MappaWoPage : VolosPage
    {
        public double? Latitudine { set { (BindingContext as MappaWoViewModel).Latitudine = value; } }
        public double? Longitudine { set { (BindingContext as MappaWoViewModel).Longitudine = value; } }

        public MappaWoPage()
        {
            InitializeComponent();
            Shell.SetTabBarIsVisible(this, false);
        }
    }
}

There are others things that I need to do to make this works?

Thank you!

Tagged:

Best Answer

Answers

Sign In or Register to comment.