Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Shell - Unable to navigate into a different shell 'sandwich' page #6073

Closed
matteopiccioni opened this issue May 2, 2019 · 7 comments
Closed

Comments

@matteopiccioni
Copy link

Description

I have a main shell page 'AppShell.xaml' with Flyout navigation
In this shell I have 3 ShellSection with a single ShellContent
In the project I attached, each ShellContent is the same page, with a label and a button
The button Clicked event should 'push' a new shell page (InnerShell.xaml), that is a sandwich tab pages.

'InnerShell' has the following structure:
RouteHost="companyname.com" RouteScheme="core" Route="testshell"
tabs (ShellItem Route)
section1
section11
section12
section2
section21
section22
section23

Using the button event of the page in 'AppShell' I try to route into the page 'section22' of 'InnerShell', but it doesnt works.

What I try:

        async void Handle_Clicked(object sender, System.EventArgs e)
        {
            try
            {
                // push the shell in old way
                // await Shell.Current.Navigation.PushAsync(new InnerShell());

                // using routing
                /*
                 *
                 * AppShell
                    RouteHost="companyname.com" RouteScheme="app" Route="testshell"
                 * 
                 * 
                 * Innershell
                    RouteHost="companyname.com" RouteScheme="core" Route="testshell"
                        tabs        (ShellItem Route)
                        section1
                            section11
                            section12
                        section2
                            section21
                            section22
                            section23                    
                 */


                // push the shell in old way. ok but I need to go to section2, tab2
                // await Shell.Current.Navigation.PushAsync(new InnerShell());

                // await Shell.Current.GoToAsync($"core:///testshell/tabs/section2/section22", true);   // not working

                await Shell.Current.GoToAsync($"core://testshell/tabs/section2/section22", true);   // not working

                // await Shell.Current.GoToAsync("core://testshell/tabs/section2/section22", true);   // not working

                // Routing.RegisterRoute("innerShell", typeof(InnerShell));
                // await Shell.Current.GoToAsync("innerShell", true);                               // works as the PushAsync
                // await Shell.Current.GoToAsync("innerShell/tabs/section2/section22", true);       // not working

            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
                lbInfo.Text = ex.Message;
            }

        }

Steps to Reproduce

The attached projects.
Start the app and click the button

Expected Behavior

Navigate into section22 route page

Actual Behavior

Exception:
unable to figure out route for: core://testshell/tabs/section2/section22
Parameter name: uri

I try with 4.0.1.383393-nightly and latest 4.0.0-pre9

In the attached project I try only in iOS

ShellNavigation.zip

@matteopiccioni matteopiccioni added s/unverified New report that has yet to be verified t/bug 🐛 labels May 2, 2019
@davidortinau
Copy link
Contributor

davidortinau commented May 2, 2019

@matteopiccioni I'm looking at your code to understand what use experience you are trying to create. Is it accurate that you have 2 looks in your app?

  1. Flyout with 3 menu items
  2. Tab "sandwich" without a flyout menu

Is there a reason you're trying to do this with multiple Shells?

@matteopiccioni
Copy link
Author

matteopiccioni commented May 2, 2019

Unfortunately yes.
The approved design of my app Is:

  • single login Page
  • After login I Will have flyout with 3 page: home page, notifications, settings and logout
  • in the home page I only have collection view of 'items'
  • when I click on an item I need to go in a sandwich page, that I suppose I can do with Shell and routing. Depending where I touch in my collection view item, I need to show a specific tab page of my 'sandwich pages'

Important: While I am in the 'sandwich pages', my flyout menù will not change. It needs to be the same after the login. And he Is always available

Onestly I already did It using TabbedPage and using prism navigation, but I'd like to remove prism and use all new features like collection view, Shell navigation and Shell tabs

Could I do it using a single shell page?

If I was not clear about my needs I could share you a video or pdf in private way

Thanks for your work,
ps: sorry for my bad english

@kingces95
Copy link
Contributor

Nested Shell's? I'd think we're gonna say that's not supported... at least at this point.

@matteopiccioni
Copy link
Author

Thanks for answer
The advantage of having shell is that we can create tabbed pages very quickly.
In the old way, to have sandwich pages, I have to create several TabbedPages, apply themes to them and painfully manage the top tabs (for iOS)
If I understand well, for my needs, unfortunately I need to remove shell and come back to MasterDetailPage and TabbedPages

@PureWeen
Copy link
Contributor

PureWeen commented May 3, 2019

@matteopiccioni please email me video or gif so I can see what you're going for please shneuvil at microsoft.com

I think this PR might help you out some
#6023

@matteopiccioni
Copy link
Author

Email sent, thanks

@samhouts samhouts removed s/unverified New report that has yet to be verified t/bug 🐛 labels May 7, 2019
@samhouts
Copy link
Member

samhouts commented May 7, 2019

At this time, we do not support multiple shells in a single app. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants