Xamarin.Forms shell - navigation inside tab

KristofBergeKristofBerge BRUniversity ✭✭
edited June 27 in Xamarin.Forms

Hi all,
I'm trying to recreate the navigation behavior shown in the attached gif (implemented with Prism) using Shell, but I'm not sure how to go about it. Basically I'm in a tab and navigating to another page inside that tab while the tabbar remains visible.
Would appreciate it if you could help me out.
Thanks in advance.

Answers

  • ColeXColeX Member, Xamarin Team Xamurai
    edited June 28

    Xamarin.Forms Shell includes a URI-based navigation experience that uses routes to navigate to any page in the application, without having to follow a set navigation hierarchy.

    You could take old way ,like await Navigation.PushAsync(new ItemDetailPage());

    But it's not the recommended way.

    Shell use Routes to navigate between pages .

    First , you have to register routes with your pages.

        <FlyoutItem ...
                    Route="animals">
            <Tab ...
                 Route="domestic">
                <ShellContent ...
                              Route="cats" />
                <ShellContent ...
                              Route="dogs" />
            </Tab>
            <ShellContent ...
                          Route="monkeys" />
            <ShellContent ...
                          Route="elephants" />  
            <ShellContent ...
                          Route="bears" />
        </FlyoutItem>
    

    Then , perform navigation ,like

    await Shell.Current.GoToAsync("//animals/monkeys");
    

    Check the official sample :https://github.com/xamarin/xamarin-forms-samples/tree/master/UserInterface/Xaminals/

  • Ashish_sharmaAshish_sharma INMember ✭✭✭

    i" Have also the problem that design flyout menu and tabbar deffrently and some menu tabs also show tabs bar

Sign In or Register to comment.