List controls present selectable rows. The Dropdown and DataGrid pages cover those controls; this page documents the list primitives.

On this page

List

Scrollable list of items.

List

A Material Design 3.0 List component with support for single-line, two-line, and three-line items.

MemberKindDescription
event EventHandler<ListItem> ItemSelectedEventOccurs when an item is selected.
event EventHandler<ListItem> ItemClickedEventOccurs when an item is clicked.
ObservableCollection<ListItem> ItemsPropertyGets or sets the collection of list items.
ListItem SelectedItemPropertyGets or sets the currently selected item (for single selection mode).
ListType TypePropertyGets or sets the list type (single-line, two-line, or three-line).
bool ShowDividersPropertyGets or sets whether to show dividers between items.
bool AllowSelectionPropertyGets or sets whether items can be selected.
SelectionMode ModePropertyGets or sets the selection mode.
float ItemHeightPropertyGets or sets the height of each list item.
float DividerThicknessPropertyGets or sets the thickness of dividers.
SKColor DividerColorPropertyGets or sets the color of dividers.
float FontSizePropertyGets or sets the font size for list items.
List()MethodInitializes a new instance of the List class.
void AddItem(string primaryText, string secondaryText = null, string tertiaryText = null, string leadingIcon = null, string trailingIcon = null, object tag = null)MethodAdds an item to the list.
void AddItem(ListItem item)MethodAdds a ListItem to the list.
void RemoveItem(ListItem item)MethodRemoves an item from the list.
void ClearItems()MethodClears all items from the list.
void SelectItem(ListItem item)MethodSelects an item in the list.

List Items

Row primitives used by lists, dropdowns and combo boxes.

ListBoxItem

Represents an item in a list box.

MemberKindDescription
string TextPropertyGets or sets the text of the item.
object ValuePropertyGets or sets the value associated with the item.
bool SelectedPropertyGets or sets whether the item is selected.
ListBoxItem()MethodInitializes a new instance of the ListBoxItem class.
ListBoxItem(string text)MethodInitializes a new instance of the ListBoxItem class with the specified text.
ListBoxItem(string text, object value)MethodInitializes a new instance of the ListBoxItem class with the specified text and value.
override string ToString()MethodReturns a string representation of the item.

ListItem

Represents an item in a list component

MemberKindDescription
string TextPropertyGets or sets the item text
string SubTextPropertyGets or sets the item sub-text
string IconPropertyGets or sets the icon name or path
SKColor TextColorPropertyGets or sets the text color
SKColor SubTextColorPropertyGets or sets the sub-text color
SKColor IconColorPropertyGets or sets the icon color
SKColor BackgroundColorPropertyGets or sets the background color
SKColor SelectedBackgroundColorPropertyGets or sets the selected background color
SKColor HoverBackgroundColorPropertyGets or sets the hover background color
float HeightPropertyGets or sets the item height
bool IsVisiblePropertyGets or sets whether the item is visible
bool IsEnabledPropertyGets or sets whether the item is enabled
bool IsSelectedPropertyGets or sets whether the item is selected
object TagPropertyGets or sets the tag object
bool IsHoveredPropertyGets whether the item is currently hovered
bool IsPressedPropertyGets whether the item is currently pressed
List ParentListPropertyGets the parent List
event EventHandler ClickEventOccurs when the item is clicked
ListItem()MethodInitializes a new instance of the ListItem class
ListItem(string text)MethodInitializes a new instance of the ListItem class with text
ListItem(string text, string subText)MethodInitializes a new instance of the ListItem class with text and sub-text
virtual void PerformClick()MethodRaises the Click event

ComboBoxItem

Represents an item in a combo box.

MemberKindDescription
string TextPropertyGets or sets the text of the item.
object ValuePropertyGets or sets the value associated with the item.
bool EnabledPropertyGets or sets whether the item is enabled.
ComboBoxItem()MethodInitializes a new instance of the ComboBoxItem class.
ComboBoxItem(string text)MethodInitializes a new instance of the ComboBoxItem class with the specified text.
ComboBoxItem(string text, object value)MethodInitializes a new instance of the ComboBoxItem class with the specified text and value.
override string ToString()MethodReturns a string representation of the item.