Shell Flyout Menu not showing all the Menu Items All the time in .NET MAUI Windows

Devi Prasad 91 Reputation points
2022-07-25T07:07:20.873+00:00

I am working with App Shell Menu Flyout to display menu items, but the menu item all are not showing all the times.
Steps to Reproduce
Step 1 : Created .NET MAUI application and Create page with Shell to display menu flyout below is the code.

<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">  
        <ShellContent Title="Home"   
                      Icon="icon_home.png">  
            <views:HomePage/>  
        </ShellContent>  
        <ShellContent Title="System Status"   
                      Icon="menu_icon_sysstatus.png">  
            <views:SystemStatusPage/>  
        </ShellContent>  
        <ShellContent Title="System Setup"   
                      Icon="menu_icon_syssetup.png">  
            <views:SystemSetupPage/>  
        </ShellContent>  
        <ShellContent Title="Settings"   
                      Icon="menu_icon_settings.png">  
            <views:SettingsPage/>  
        </ShellContent>  
    </FlyoutItem>  

Step 2 : When I run the application in windows For the first time when flyout menu it is showing all the menu items and Home Page as selected one as below Image.
224272-menu1.png

Step 3: After that when I select System Status Menu Item it is not showing Settings and About Menu Items
224207-menu2.png

Expected Behavior
It should display all the menu item all the time when menu flyout open.

Basic Information
Visual Studio 2022 version 17.3 Preview 2.0

Can find the reproducible example from the git ShellPOC.git

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,868 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,247 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,316 Reputation points Microsoft Vendor
    2022-07-28T07:24:01.533+00:00

    Hello @Devi Prasad ,

    You set FlyoutItem.FlyoutDisplayOptions property to AsMultipleItems, it indicates that the item and its direct children will be visible in the flyout as a group of items.
    As noted in the doc - Tabs are displayed when a FlyoutItem contains more than one ShellContent object. But there is no Tab element in your code. You could remove the FlyoutItem or add the Tab, refer to the following code:

    <!--<FlyoutItem FlyoutDisplayOptions="AsMultipleItems" >-->//remove FlyoutItem   
            <!--<Tab  Title="Home">-->//or add tab  
            <ShellContent Title="Home">  
                <local:MainPage/>  
            </ShellContent>  
            <!--</Tab>-->  
            ......  
         <!--</FlyoutItem>-->  
    

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.