Class ListItem
- Namespace
- SharpConsoleUI.Controls
- Assembly
- SharpConsoleUI.dll
Represents an item in a ListControl.
public class ListItem
- Inheritance
-
ListItem
- Inherited Members
Constructors
ListItem(string, string?, Color?)
Initializes a new ListItem with text, optional icon, and icon color.
public ListItem(string text, string? icon = null, Color? iconColor = null)
Parameters
textstringThe text content of the item.
iconstringOptional icon to display before the text.
iconColorColor?Optional color for the icon.
Properties
Icon
Gets or sets the icon 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 this item is enabled.
public bool IsEnabled { get; set; }
Property Value
Lines
Gets the text split into separate lines for multi-line items.
public List<string> Lines { get; }
Property Value
Tag
Gets or sets a custom object associated with this item.
public object? Tag { get; set; }
Property Value
Text
Gets or sets the text content of the item.
public string Text { get; set; }
Property Value
Operators
implicit operator ListItem(string)
Implicitly converts a string to a ListItem for convenience.
public static implicit operator ListItem(string text)
Parameters
textstringThe text to convert.