Show / Hide Table of Contents

# Class MenuItem

A menu item has a title, an associated help text, and an action to execute on activation.

##### Inheritance

System.Object
MenuItem

###### Namespace: Terminal.Gui

###### Assembly: Terminal.Gui.dll

##### Syntax

    public class MenuItem

### Constructors

#### MenuItem(ustring, String, Action)

Initializes a new MenuItem.

##### Declaration

    public MenuItem (NStack.ustring title, string help, Action action);

##### Parameters

Type | Name | Description
--- | --- | ---
NStack.ustring | title | Title for the menu item.
System.String | help | Help text to display.
System.Action | action | Action to invoke when the menu item is activated.

### Fields

#### HotKey

The hotkey is used when the menu is active, the shortcut can be triggered when the menu is not active.
For example HotKey would be "N" when the File Menu is open (assuming there is a "_New" entry if the ShortCut is set to "Control-N", this would be a global hotkey that would trigger as well

##### Declaration

    public Rune HotKey;

##### Field Value

Type | Description
--- | ---
System.Rune | To be added.

#### ShortCut

This is the global setting that can be used as a global shortcut to invoke the action on the menu.

##### Declaration

    public Terminal.Gui.Key ShortCut;

##### Field Value

Type | Description
--- | ---
Key | To be added.

### Properties

#### Action

Gets or sets the action to be invoked when the menu is triggered

##### Declaration

    public Action Action { get; set; }

##### Property Value

Type | Description
--- | ---
System.Action | Method to invoke.

#### Help

Gets or sets the help text for the menu item.

##### Declaration

    public NStack.ustring Help { get; set; }

##### Property Value

Type | Description
--- | ---
NStack.ustring | The help text.

#### Title

Gets or sets the title.

##### Declaration

    public NStack.ustring Title { get; set; }

##### Property Value

Type | Description
--- | ---
NStack.ustring | The title.