Class ListBox
Represents a list box control in the user interface.
Assembly: MicroLayout.dll
View Source
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
public Func<object, string>? RowFormatter { get; set; }
ItemSpacing
Spacing, in pixels, between items
View Source
public int ItemSpacing { get; }
Items
Items to display in the ListBox
View Source
public ObservableCollection<object> Items { get; }
SelectedRowColor
Gets or sets the background color for a selected row
View Source
public Color SelectedRowColor { get; set; }
SelectedTextColor
Gets or sets the background color for a selected row
View Source
public Color SelectedTextColor { get; set; }
TextColor
Gets or sets the foreground color of list items
View Source
public Color TextColor { get; set; }
SelectedItem
The value of the selected Item
View Source
public object? SelectedItem { get; }
SelectedIndex
The index of the currently selected Item
View Source
public int SelectedIndex { get; set; }
TopIndex
Gets or sets the index of the top visible Item
View Source
public int TopIndex { get; set; }
Methods
ApplyTheme(DisplayTheme)
Applies the specified display theme to the control.
View Source
public override void ApplyTheme(DisplayTheme theme)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Foundation.Graphics.MicroLayout.DisplayTheme | theme | The 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
protected override void OnDraw(MicroGraphics graphics)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Foundation.Graphics.MicroGraphics surface to draw the control on. |