Class NavigationItem
- Namespace
- SharpConsoleUI.Controls
- Assembly
- SharpConsoleUI.dll
Represents a single item in a NavigationView control.
public class NavigationItem
- Inheritance
-
NavigationItem
- Inherited Members
- Extension Methods
Constructors
NavigationItem(string, string?, string?)
Initializes a new instance of the NavigationItem class.
public NavigationItem(string text, string? icon = null, string? subtitle = null)
Parameters
textstringThe display text.
iconstringOptional icon prefix.
subtitlestringOptional subtitle for the content header.
Properties
HeaderColor
Gets or sets an optional color for header items.
public Color? HeaderColor { get; set; }
Property Value
Icon
Gets or sets an optional icon (emoji/symbol) prefix shown before the text.
public string? Icon { get; set; }
Property Value
IsEnabled
Gets or sets whether this item is enabled and can be selected.
public bool IsEnabled { get; set; }
Property Value
IsExpanded
Gets or sets whether a header's children are visible. Only meaningful for items with ItemType == Header.
public bool IsExpanded { get; set; }
Property Value
ItemType
Gets the type of this navigation item (Item, Header, or Separator).
public NavigationItemType ItemType { get; }
Property Value
ParentHeader
Gets the parent header for sub-items, or null for top-level items.
public NavigationItem? ParentHeader { get; }
Property Value
Subtitle
Gets or sets an optional subtitle shown in the content header when this item is selected.
public string? Subtitle { get; set; }
Property Value
Tag
Gets or sets custom metadata associated with this item.
public object? Tag { get; set; }
Property Value
Text
Gets or sets the display text for this navigation item.
public string Text { get; set; }
Property Value
Methods
CreateHeader(string, Color?)
Creates a header item that groups child items.
public static NavigationItem CreateHeader(string text, Color? color = null)
Parameters
Returns
CreateSeparator()
Creates a separator item (visual divider).
public static NavigationItem CreateSeparator()
Returns
Operators
implicit operator NavigationItem(string)
Implicit conversion from string to NavigationItem.
public static implicit operator NavigationItem(string text)
Parameters
textstring