Class ListView
- Namespace
- Myra.Graphics2D.UI
- Assembly
- Myra.dll
A list view widget that displays a scrollable collection of items and supports single or multiple selection.
public class ListView : Widget, IItemWithId, INotifyAttachedPropertyChanged, IContainer
- Inheritance
-
ListView
- Implements
- Inherited Members
Constructors
ListView(Stylesheet, string)
Initializes a new instance of the ListView class with the specified stylesheet and style.
public ListView(Stylesheet stylesheet, string styleName = "")
Parameters
stylesheetStylesheetThe stylesheet to use for applying the style.
styleNamestringThe name of the style to apply to the list view.
ListView(string)
Initializes a new instance of the ListView class.
public ListView(string styleName = "")
Parameters
styleNamestringThe name of the style to apply to the list view.
Properties
ListBoxStyle
Gets or sets the style applied to the list view.
[Browsable(false)]
public ListBoxStyle ListBoxStyle { get; set; }
Property Value
ScrollViewer
Gets the scroll viewer that manages scrolling for the list view items.
[Browsable(false)]
public ScrollViewer ScrollViewer { get; }
Property Value
SelectedIndex
Gets or sets the zero-based index of the currently selected item, or null if no item is selected.
[Browsable(false)]
public int? SelectedIndex { get; set; }
Property Value
- int?
SelectedItem
Gets or sets the currently selected item widget, or null if no item is selected.
[Browsable(false)]
public Widget SelectedItem { get; set; }
Property Value
SelectionMode
Gets or sets whether items can be selected individually or in multiple selections.
public SelectionMode SelectionMode { get; set; }
Property Value
Widgets
Gets the collection of items in the list view.
[Browsable(false)]
public IList<Widget> Widgets { get; }
Property Value
Methods
ApplyListViewStyle(ListBoxStyle)
Applies the specified list box style to this list view.
public void ApplyListViewStyle(ListBoxStyle listBoxStyle)
Parameters
listBoxStyleListBoxStyleThe list box style to apply.
ApplyStyle(WidgetStyle)
Applies the specified widget style to this list view.
protected override void ApplyStyle(WidgetStyle style)
Parameters
styleWidgetStyleThe widget style to apply.
CopyFrom(Widget)
Copies the style and items from another list view.
protected override void CopyFrom(Widget w)
Parameters
wWidgetThe source list view to copy from.
OnKeyDown(Keys)
Handles keyboard input for navigation (Up, Down, Enter keys).
public override void OnKeyDown(Keys k)
Parameters
kKeysThe key being pressed.
OnMouseWheel(float)
Handles mouse wheel scrolling for the list view.
public override void OnMouseWheel(float delta)
Parameters
deltafloatThe mouse wheel delta value.
OnSelectedItemChanged()
Raises the selected item changed event and updates the parent combo box if present.
protected void OnSelectedItemChanged()
Events
SelectedIndexChanged
Occurs when the selected item changes.
public event MyraEventHandler SelectedIndexChanged