liveBook · Manning

Menu

As explained in .NET MAUI in Action

A menu is a user-interface component that presents a list of commands or destinations for selection.

A menu presents application commands or destinations in a familiar desktop interaction pattern. In .NET MAUI, MenuBarItems appear at the top of Windows windows or macOS screens, but are not rendered on iOS or Android. section 7.2.5

Build a page menu from these parts:

  • Add MenuBarItem objects to a page’s MenuBarItems collection to create top-level menus. section 10.3.3
  • Place MenuFlyoutItems inside a menu for labeled actions, or group them with MenuFlyoutSubItems for submenus. section 10.3.3
  • Execute an action through a MenuFlyoutItem Clicked event or Command binding. section 10.3.3

Help and About

A report page can define a Help menu containing an About item. Bind that item’s Command to ShowAboutPageCommand so selecting About triggers the application action. section 10.3.3

How .NET MAUI in Action covers it

How deep it goes
Defines menu hierarchy and action wiring through XAML, but defers detailed platform-specific menu behavior.
Examples
Uses a ReportPage Help menu containing an About item bound to ShowAboutPageCommand.
What you can do after
Operate/configure a .NET MAUI page with desktop menus and connect items to commands or Clicked event handlers.
How it connects
Connects MenuBarItems with MenuBarItem, MenuFlyoutItem, MenuFlyoutSubItem, XAML, commands, and desktop layouts.

Also explained in

Compare how 3 books explain menu →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.