Table of Contents

Class DropdownItem

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

Represents an item in a DropdownControl with text, optional icon, and metadata.

public class DropdownItem
Inheritance
DropdownItem
Inherited Members

Constructors

DropdownItem(string, string?, Color?)

Initializes a new instance of the DropdownItem class.

public DropdownItem(string text, string? icon = null, Color? iconColor = null)

Parameters

text string

The display text for the item.

icon string

Optional icon character or string to display before the text.

iconColor Color?

Optional color for the icon.

Properties

Icon

Gets or sets the icon character or string displayed before the item text.

public string? Icon { get; set; }

Property Value

string

IconColor

Gets or sets the color of the icon.

public Color? IconColor { get; set; }

Property Value

Color?

IsEnabled

Gets or sets whether the item is enabled and can be selected.

public bool IsEnabled { get; set; }

Property Value

bool

Tag

Gets or sets custom data associated with this item.

public object? Tag { get; set; }

Property Value

object

Text

Gets or sets the display text for the item.

public string Text { get; set; }

Property Value

string

Operators

implicit operator DropdownItem(string)

Implicitly converts a string to a DropdownItem for convenience.

public static implicit operator DropdownItem(string text)

Parameters

text string

The text to convert.

Returns

DropdownItem

A new DropdownItem with the specified text.