Skip to main content

Class ListBox

Represents a list box control in the user interface.

Assembly: MicroLayout.dll
View Source
Declaration
public class ListBox : MicroLayout, IThemedControl, IControl

Inheritance: System.Object -> Meadow.Foundation.Graphics.MicroLayout.Control

Implements:
Meadow.Foundation.Graphics.MicroLayout.IThemedControl

Properties

RowFormatter

An optional function to provide formatting for row objects

View Source
Declaration
public Func<object, string>? RowFormatter { get; set; }

ItemSpacing

Spacing, in pixels, between items

View Source
Declaration
public int ItemSpacing { get; }

Items

Items to display in the ListBox

View Source
Declaration
public ObservableCollection<object> Items { get; }

SelectedRowColor

Gets or sets the background color for a selected row

View Source
Declaration
public Color SelectedRowColor { get; set; }

SelectedTextColor

Gets or sets the background color for a selected row

View Source
Declaration
public Color SelectedTextColor { get; set; }

TextColor

Gets or sets the foreground color of list items

View Source
Declaration
public Color TextColor { get; set; }

SelectedItem

The value of the selected Item

View Source
Declaration
public object? SelectedItem { get; }

SelectedIndex

The index of the currently selected Item

View Source
Declaration
public int SelectedIndex { get; set; }

TopIndex

Gets or sets the index of the top visible Item

View Source
Declaration
public int TopIndex { get; set; }

Methods

ApplyTheme(DisplayTheme)

Applies the specified display theme to the control.

View Source
Declaration
public override void ApplyTheme(DisplayTheme theme)
Parameters
TypeNameDescription
Meadow.Foundation.Graphics.MicroLayout.DisplayThemethemeThe display theme to apply.

OnDraw(MicroGraphics)

Performs the actual drawing of the control on the specified Meadow.Foundation.Graphics.MicroGraphics surface. This method must be implemented in derived classes.

View Source
Declaration
protected override void OnDraw(MicroGraphics graphics)
Parameters
TypeNameDescription
Meadow.Foundation.Graphics.MicroGraphics surface to draw the control on.

Implements