Table of Contents

Constructor MenuItem

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

MenuItem()

Creates a new instance of MenuItem.

public MenuItem()

MenuItem(View?, Command, string?, string?, Menu?)

Creates a new instance of MenuItem, binding it to targetView and command. The Key targetView has bound to command will be used as Key.

public MenuItem(View? targetView, Command command, string? commandText = null, string? helpText = null, Menu? subMenu = null)

Parameters

targetView View

The View that command will be invoked on when user does something that causes the Shortcut'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.

helpText string

The help text to display.

subMenu Menu

The submenu to display when the user selects this menu item.

MenuItem(string?, string?, Action?, Key?)

public MenuItem(string? commandText = null, string? helpText = null, Action? action = null, Key? key = null)

Parameters

commandText string
helpText string
action Action
key Key

MenuItem(string, Key, Action?)

public MenuItem(string commandText, Key key, Action? action = null)

Parameters

commandText string
key Key
action Action

MenuItem(string?, string?, Menu?)

public MenuItem(string? commandText = null, string? helpText = null, Menu? subMenu = null)

Parameters

commandText string
helpText string
subMenu Menu