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
textstringThe display text for the item.
iconstringOptional icon character or string to display before the text.
iconColorColor?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
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
Tag
Gets or sets custom data associated with this item.
public object? Tag { get; set; }
Property Value
Text
Gets or sets the display text for the item.
public string Text { get; set; }
Property Value
Operators
implicit operator DropdownItem(string)
Implicitly converts a string to a DropdownItem for convenience.
public static implicit operator DropdownItem(string text)
Parameters
textstringThe text to convert.
Returns
- DropdownItem
A new DropdownItem with the specified text.