dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.05k stars 1.73k forks source link

Can menu bar set in Caption\Title Bar? #7160

Open jim-jiang-github opened 2 years ago

jim-jiang-github commented 2 years ago

Description

Is there any way to set the menu bar to the caption on windows? I try set the menu bar in 'ContentPage' and got the result: image

And another way is set the menu bar to 'Platforms' folder's App.xaml, And I got this: image

It looks beautiful, But how can I Trigger the menu event or binding the command???

Public API Changes

 <ContentPage.MenuBarItems>
        <MenuBarItem Text="File">
            <MenuFlyoutItem Text="Open" />
            <MenuFlyoutItem Text="Save" />
            <MenuFlyoutItem Text="Exit" />
        </MenuBarItem>
        <MenuBarItem Text="Edit">
            <MenuFlyoutSubItem Text="Rotate">
                <MenuFlyoutItem Text="Rotate 90" />
                <MenuFlyoutItem Text="Rotate 180" />
                <MenuFlyoutItem Text="Rotate 270" />
                <MenuFlyoutItem Text="Rotate 360" />
            </MenuFlyoutSubItem>
            <MenuFlyoutItem Text="Zoom" />
            <MenuFlyoutItem Text="Reset" />
        </MenuBarItem>
    </ContentPage.MenuBarItems>

Intended Use-Case

Can menu bar set in caption?

PureWeen commented 2 years ago

@jim-jiang-github that's the eventual plan :-) We're waiting on some additional behavior to make its way to WinAppSDK and then we'll enable the option of moving the menu up into the title bar

Jarek300 commented 2 years ago

Does it mean that WinUI 3 title bar customization described here will be supported by Maui Windows application? In .NET 7?

mattleibow commented 1 year ago

@PureWeen is htis maybe something that we can do with the "extends into titlebar" code as it looks like the issue here is just putting the menu in the title? Or is this different?

Also @jim-jiang-github what is your idea about dragging and double clicking to maximize if the menu is in the title bar? Will the menu still work and maybe you are thinking for the menu is a menu, but the remaining space is for the user interaction?

@PureWeen do we have a MAUI issue tracking this new feature of total titlebar customization? Is this a missing feature in the WinUI SDK or just not yet in MAUI?

mattleibow commented 1 year ago

Could this be linked to the other issue #7123

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.