Search Results for

    Show / Hide Table of Contents

    Class StatusItem

    StatusItem objects are contained by StatusBar Views. Each StatusItem has a title, a shortcut (hotkey), and an Action that will be invoked when the Shortcut is pressed. The Shortcut will be a global hotkey for the application in the current context of the screen. The colour of the Title will be changed after each ~. A Title set to `~F1~ Help` will render as *F1* using HotNormal and *Help* as HotNormal.
    Inheritance
    System.Object
    StatusItem
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Terminal.Gui
    Assembly: Terminal.Gui.dll
    Syntax
    public class StatusItem

    Constructors

    | Improve this Doc View Source

    StatusItem(Key, ustring, Action, Func<Boolean>)

    Initializes a new StatusItem.
    Declaration
    public StatusItem(Key shortcut, ustring title, Action action, Func<bool> canExecute = null)
    Parameters
    Type Name Description
    Key shortcut Shortcut to activate the StatusItem.
    ustring title Title for the StatusItem.
    System.Action action Action to invoke when the StatusItem is activated.
    System.Func<System.Boolean> canExecute Function to determine if the action can currently be executed.

    Properties

    | Improve this Doc View Source

    Action

    Gets or sets the action to be invoked when the statusbar item is triggered
    Declaration
    public Action Action { get; set; }
    Property Value
    Type Description
    System.Action Action to invoke.
    | Improve this Doc View Source

    CanExecute

    Gets or sets the action to be invoked to determine if the StatusItem can be triggered. If CanExecute returns true the status item will be enabled. Otherwise, it will be disabled.
    Declaration
    public Func<bool> CanExecute { get; set; }
    Property Value
    Type Description
    System.Func<System.Boolean> Function to determine if the action is can be executed or not.
    | Improve this Doc View Source

    Data

    Gets or sets arbitrary data for the status item.
    Declaration
    public object Data { get; set; }
    Property Value
    Type Description
    System.Object
    | Improve this Doc View Source

    Shortcut

    Gets the global shortcut to invoke the action on the menu.
    Declaration
    public Key Shortcut { get; }
    Property Value
    Type Description
    Key
    | Improve this Doc View Source

    Title

    Gets or sets the title.
    Declaration
    public ustring Title { get; set; }
    Property Value
    Type Description
    ustring The title.

    Methods

    | Improve this Doc View Source

    IsEnabled()

    Returns true if the status item is enabled. This method is a wrapper around CanExecute.
    Declaration
    public bool IsEnabled()
    Returns
    Type Description
    System.Boolean
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX