Table of Contents

Constructor MenuBarItem

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

MenuBarItem()

Creates a new instance of MenuBarItem.

public MenuBarItem()

MenuBarItem(View?, Command, string?, PopoverMenu?)

Creates a new instance of MenuBarItem. Each MenuBarItem typically has a PopoverMenu that is shown when the item is selected.

public MenuBarItem(View? targetView, Command command, string? commandText, PopoverMenu? popoverMenu = null)

Parameters

targetView View

The View that command will be invoked on when user does something that causes the MenuBarItems's Accept event to be raised.

command Command

The Command to invoke on targetView. The Key targetView has bound to command will be used as Key

commandText string

The text to display for the command.

popoverMenu PopoverMenu

The Popover Menu that will be displayed when this item is selected.

MenuBarItem(string, PopoverMenu?)

Creates a new instance of MenuBarItem with the specified popoverMenu. This is a helper for the most common MenuBar use-cases.

public MenuBarItem(string commandText, PopoverMenu? popoverMenu = null)

Parameters

commandText string

The text to display for the command.

popoverMenu PopoverMenu

The Popover Menu that will be displayed when this item is selected.

MenuBarItem(string, IEnumerable<View>)

Creates a new instance of MenuBarItem with the menuItems automatcialy added to a PopoverMenu. This is a helper for the most common MenuBar use-cases.

public MenuBarItem(string commandText, IEnumerable<View> menuItems)

Parameters

commandText string

The text to display for the command.

menuItems IEnumerable<View>

The menu items that will be added to the Popover Menu that will be displayed when this item is selected.