Table of Contents

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

stylesheet Stylesheet

The stylesheet to use for applying the style.

styleName string

The 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

styleName string

The 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

ListBoxStyle

ScrollViewer

Gets the scroll viewer that manages scrolling for the list view items.

[Browsable(false)]
public ScrollViewer ScrollViewer { get; }

Property Value

ScrollViewer

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

Widget

SelectionMode

Gets or sets whether items can be selected individually or in multiple selections.

public SelectionMode SelectionMode { get; set; }

Property Value

SelectionMode

Widgets

Gets the collection of items in the list view.

[Browsable(false)]
public IList<Widget> Widgets { get; }

Property Value

IList<Widget>

Methods

ApplyListViewStyle(ListBoxStyle)

Applies the specified list box style to this list view.

public void ApplyListViewStyle(ListBoxStyle listBoxStyle)

Parameters

listBoxStyle ListBoxStyle

The list box style to apply.

ApplyStyle(WidgetStyle)

Applies the specified widget style to this list view.

protected override void ApplyStyle(WidgetStyle style)

Parameters

style WidgetStyle

The widget style to apply.

CopyFrom(Widget)

Copies the style and items from another list view.

protected override void CopyFrom(Widget w)

Parameters

w Widget

The source list view to copy from.

OnKeyDown(Keys)

Handles keyboard input for navigation (Up, Down, Enter keys).

public override void OnKeyDown(Keys k)

Parameters

k Keys

The key being pressed.

OnMouseWheel(float)

Handles mouse wheel scrolling for the list view.

public override void OnMouseWheel(float delta)

Parameters

delta float

The 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

Event Type

MyraEventHandler