liveBook · Manning

MenuFlyoutItem

As explained in .NET MAUI in Action

MenuFlyoutItem is a .NET MAUI menu item that displays text and exposes actions through events or commands.

MenuFlyoutItem adds a text-labeled action to a .NET MAUI desktop menu. Place it inside a MenuBarItem in a page’s MenuBarItems collection, then handle activation with either Clicked or Command. section 10.3.3

Choose the activation approach that fits the page:

  • Use Clicked when the action belongs in a code-behind event handler. section 10.3.3
  • Use Command when the action belongs in the binding context or view model. section 10.3.3

An About menu command

A ReportPage can define a Help MenuBarItem containing a MenuFlyoutItem whose Text is About and whose Command binds to ShowAboutPageCommand. Selecting it can trigger the view-model action that opens an AboutPage in a new window. section 10.3.3

How .NET MAUI in Action covers it

How deep it goes
Defines placement, display text, and two activation mechanisms, but defers detailed event and command implementation.
Examples
Uses a Help menu with an About item on ReportPage and a command that opens AboutPage.
What it assumes
Assumes knowledge of pages, MenuBarItems, MenuBarItem, and either code-behind handlers or binding contexts.
What you can do after
Apply it via .NET MAUI XAML by adding a labeled item and binding or handling its action.
How it connects
Connects MenuBarItems, MenuBarItem, Clicked events, commands, data binding, and desktop windows.

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.