Table of Contents

Class ComboView

Namespace
Myra.Graphics2D.UI
Assembly
Myra.dll

A combo view widget that displays a list of widget items in a dropdown menu and supports selection.

public class ComboView : Widget, IItemWithId, INotifyAttachedPropertyChanged, IContainer
Inheritance
ComboView
Implements
Inherited Members

Constructors

ComboView(Stylesheet, string)

Initializes a new instance of the ComboView class with the specified stylesheet and style.

public ComboView(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 combo view.

ComboView(string)

Initializes a new instance of the ComboView class.

public ComboView(string styleName = "")

Parameters

styleName string

The name of the style to apply to the combo view.

Properties

Desktop

Gets or sets the desktop that manages this combo view and its dropdown menu.

public override Desktop Desktop { get; }

Property Value

Desktop

DropdownMaximumHeight

Gets or sets the maximum height of the dropdown list in pixels.

public int? DropdownMaximumHeight { get; set; }

Property Value

int?

IsExpanded

Gets a value indicating whether the dropdown list is currently visible.

[Browsable(false)]
public bool IsExpanded { get; }

Property Value

bool

ListView

Gets the list view that displays the dropdown items.

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

Property Value

ListView

SelectedIndex

Gets or sets the 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.

[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 combo view.

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

Property Value

IList<Widget>

Methods

ApplyStyle(WidgetStyle)

Applies the specified widget style to this combo view.

protected override void ApplyStyle(WidgetStyle style)

Parameters

style WidgetStyle

The widget style to apply.

CopyFrom(Widget)

Copies the style and items from another combo view.

protected override void CopyFrom(Widget w)

Parameters

w Widget

The source combo view to copy from.

InternalArrange()

Arranges the combo view and its dropdown list within the measured bounds.

protected override void InternalArrange()

InternalMeasure(Point)

Measures the size required for the combo view, considering the dropdown list width.

protected override Point InternalMeasure(Point availableSize)

Parameters

availableSize Point

The available size for the combo view.

Returns

Point

The measured size needed for the combo view.

OnKeyDown(Keys)

Handles keyboard input and delegates it to the dropdown list.

public override void OnKeyDown(Keys k)

Parameters

k Keys

The key being pressed.

Events

SelectedIndexChanged

Occurs when the selected item changes.

public event MyraEventHandler SelectedIndexChanged

Event Type

MyraEventHandler