The following example shows a menu bar item, where the icons for menu items are defined using font icons: Mac Catalyst does not support displaying icons on menu items. This icon can either be an image, or a font icon. MenuFlyoutItem and MenuFlyoutSubItem inherit the IconImageSource property from MenuItem, which enables a small icon to be displayed next to the text for a menu item. In this example, each MenuFlyoutItem defines a menu item that executes an ICommand when selected. Each top-level menu has menu items, and the second top-level menu has a sub-menu and a separator: This example defines three top-level menus. The following example shows a ContentPage that defines menu bar items: MenuBarItem objects can be added to the MenuBarItems collection, of type IList, on a ContentPage.NET MAUI desktop apps will display a menu bar, containing menu items, when they are added to any ContentPage that's hosted in a NavigationPage or a Shell app. The response to a menu item, or sub-item, click can be defined by setting the Clicked, Command, and CommandParameter properties. The appearance of a menu item, or sub-item, can be defined by setting the Text, and IconImageSource properties. MenuItem defines multiple properties that enable the appearance and behavior of a menu item to be specified. MenuFlyoutSubItem derives from MenuFlyoutItem, which in turn derives from MenuItem. MenuFlyoutSeparator, which is a horizontal line that separates items in the menu.MenuFlyoutSubItem, which represents a sub-menu item that can be clicked.MenuFlyoutItem, which represents a menu item that can be clicked.These properties are backed by BindableProperty objects, which means that they can be targets of data bindings, and styled.Ī MenuBarItem can consist of the following children: The default value of this property is true. IsEnabled, of type boolean, specifies whether the menu is enabled.Text, of type string, defines the menu text.MenuBarItem defines the following properties: NET Multi-platform App UI (.NET MAUI) menu bar is a container that presents a set of menus in a horizontal row, at the top of an app on Mac Catalyst and Windows.Įach top-level menu in the menu bar, known as a menu bar item, is represented by a MenuBarItem object.
0 Comments
Leave a Reply. |