Can I have a Xamarin Shell redirect to a second Shell

Mark Rooney 21 Reputation points
2021-03-12T00:26:00.053+00:00

I am building an application that has several layers of menus. I would like to leverage the shell paradigm to accomplish this. How can I have a shell call another shell?

At my App.Shell I have the following:
<FlyoutItem.Icon>
<FontImageSource FontFamily="FontAwesome6ProLight300" Color="Black" Glyph=""/>
</FlyoutItem.Icon>
<ShellContent Route="ExplorerMenu" ContentTemplate="{DataTemplate local:ExplorerMenu}"/>
</FlyoutItem>
Which would call a second menu (Explorer). I've resgistered the second menu in my route, but I get the following error:

Error XFC0000 Cannot resolve type "ExplorerMenu".

Any help would be appreciated in how to load a second shell menu.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Cole Xia (Shanghai Wicresoft Co,.Ltd.) 6,751 Reputation points
    2021-03-12T06:17:16.463+00:00

    Hello,

    Welcome to Microsoft Q&A!

    I suggest you create two class for different shell , and switch the App.Current.MainPage when redirecting .

       App.Current.MainPage = new NewShell();  
    

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments