MAUi Catalyst app not working

Jassim Al Rahma 1,566 Reputation points
2022-08-26T16:29:15+00:00

Hi,

I created a simple MAUI app with Menu and tried to run it on My Mac but I am not getting the menu, just getting the window only.

Here is my XAML:

<?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="MauiAppTest.MainPage">  
    <ContentPage.MenuBarItems>  
        <MenuBarItem Text="File">  
            <MenuFlyoutItem Text="Exit" />  
        </MenuBarItem>  
        <MenuBarItem Text="Locations">  
            <MenuFlyoutSubItem Text="Change Location">  
                <MenuFlyoutItem Text="Redmond, USA" />  
                <MenuFlyoutItem Text="London, UK" />  
                <MenuFlyoutItem Text="Berlin, DE" />  
            </MenuFlyoutSubItem>  
            <MenuFlyoutItem Text="Add Location" />  
        </MenuBarItem>  
        <MenuBarItem Text="View">  
            <MenuFlyoutItem Text="Refresh" />  
            <MenuFlyoutItem Text="Change Theme" />  
        </MenuBarItem>  
    </ContentPage.MenuBarItems>  
</ContentPage>  

and this is my App.xaml.cs:

namespace MauiAppTest;  
  
public partial class App : Application  
{  
	public App()  
	{  
		InitializeComponent();  
  
        // MainPage = new AppShell();  
        MainPage = new NavigationPage(new MainPage());  
    }  
}  

Kindly help..

Thanks.
Jassim

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,412 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 42,001 Reputation points Microsoft Vendor
    2022-08-29T06:12:25.88+00:00

    Hello,

    I've tested your code on Mac, and it worked fine as expected.

    I am not getting the menu, just getting the window only.

    On Mac platform, the menu bar will appear at the top of the screen instead of in the window.

    You could refer to What’s in the menu bar on Mac? to get more details.

    Best Regards,

    Alec Liu.


    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.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.