Menu Separator and Keyboard shortcut in MAUI

Jassim Al Rahma 1,571 Reputation points
2022-08-29T19:36:37.11+00:00

Hi,

How can I add a menu separator and keyboard shortcut in the below menu?

<MenuBarItem Text="File">  
    <MenuFlyoutItem Text="New"  />  
    <MenuFlyoutItem Text="Open" />  
    <MenuFlyoutItem Text="Save" />  
    <MenuFlyoutItem Text="Save As" />  
    <MenuFlyoutItem Text="Close" />  
    <MenuFlyoutItem Text="Exit" Clicked="FileExitMenuFlyoutItem_Clicked" />  
    <MenuFlyoutItem Text="Recent" />  
</MenuBarItem>  

Thanks,
Jassim

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

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 43,371 Reputation points Microsoft Vendor
    2022-08-30T05:58:53.047+00:00

    Hello,

    There is no such an API to implement Separator and Keyboard shortcut in MAUI right now.

    You could refer to this issue Menu missing accelerators to get the method about how to map Accelerator Key to menu items.

    For using Separator, please refer to Include an option to add a menu item separator. Sometimes menu items need to be logically grouped. #5999.

    In this issue, you could find Menu Separators have been added for the Net7 milestone(so not yet available). It only affects Platforms which have a concept of a menu separator (Windows: yes, iOS & Android: no, MacCatalyst: yes).

    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.