Search code examples
desktop-applicationmaui

.Net MAUI - MenuBarItems below ContentPage title


I would like to have the MenuBarItem below the ContentPage Title. Is it possible?

note found on Microsoft Learn: A .NET Multi-platform App UI (.NET MAUI) menu bar is a container that presents a set of menus in a horizontal row, at the top of an app on Mac Catalyst and Windows.

Here the code of my Page

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MPC_MassPropertiesCalculator_MAUIapp.Views.MPCFileDemo"
             Title="MPC - File Demo">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="2*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="100" />
        </Grid.RowDefinitions>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
     </Grid>

    
    <ContentPage.MenuBarItems>
    <MenuBarItem Text="Open MPC File" Grid.Row="1">
        
        
    </MenuBarItem>
        <MenuBarItem Text="Compare" Grid.Row="1">
           
        </MenuBarItem>
    </ContentPage.MenuBarItems>
            
</ContentPage>

Here the outpout window on Windows Machine enter image description here


Solution

  • According to Microsoft documentation, a menu bar is a container that displays a set of menus in a horizontal row at the top of a desktop application and does not provide a way to change its position.