Shell menu not render
See original GitHub issueHi, I have an application that has a login page without a menu that, after the login logic takes the user to a page with the side menu.
So I have created the first page like this:
return new Shell() {
new ContentPage()
{
new VStack {
new Button("go to shell").VCenter().HCenter().OnTapped(goToSecond)
}
}
}.BackButtonIsVisible(false);
and the second page:
public override VisualNode Render()
=> new Shell
{
new FlyoutItem("Page1")
{
new ContentPage("Page1")
{
new Label("PAGE 1").VCenter().HCenter().FontSize(50)
}
},
new FlyoutItem("Page2")
{
new ContentPage("Page2")
{
new Label("PAGE 2").VCenter().HCenter().FontSize(50)
}
}
}
.BackButtonIsVisible(false)
.ItemTemplate(RenderItemTemplate);
static VisualNode RenderItemTemplate(MauiControls.BaseShellItem item)
=> new Grid("68", "*")
{
new Label(item.Title)
.VCenter()
.Margin(10,0)
};
If I set the first page as “main page”, then click on the button, the second page is open but without the shell side menu. If I set the second comage as “main page” the shell menu is rendered correctly.
How can I fix this?
Attached a sample.
Thank you MauiTest.zip
Issue Analytics
- State:
- Created 3 months ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
[Bug] Menus doesn't render in Shell if not part of Shell #5210
If I put menus on a ContentPage that is a FlyoutItem, then the menu renders. image. However, if I navigate to a page...
Read more >menu items either do not load or render invisible [Windows ...
Steps to reproduce the behavior: Run Open Shell. Click or press on the Windows button to bring up the start menu. See error....
Read more >Shell Flyout Menu not showing all the Menu Items ...
I am working with App Shell Menu Flyout to display menu items, but the menu item all are not showing all the times....
Read more >Xamarin iOS Shell FlyoutMenu not rendering correctly
Xamarin iOS Shell FlyoutMenu not rendering correctly ... I am using Shell in my App to handle navigation between views and its FlyoutMenu ......
Read more >Unable to copy from shell
I usually run a script, then right click | copy. but that option no longer appears for text highlighted in the shell window....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It’s an issue/feature of the shell control in MAUI. Pages are always cached (at least in current version) (https://github.com/dotnet/maui/issues/9300).
One solution could be handling the OnNavigated() event on the shell or the OnAppearing() event on child page and modify the page state accordly.
For example you could add .OnAppearing(()=> SetState(s => s.Title = 0)) on SecondPage
Well, it is more like a .NET MAUI issue, I mean, not an issue, probably more like which strategy to use to present a content page before a Shell. Surely there are more options but one could be using the Window, with a code like this (not tested):
Anyway I’ll take a look at your sample to see if there is anything wrong with MauiReactor/.NET MAUI