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
stylesheetStylesheetThe stylesheet to use for applying the style.
styleNamestringThe 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
styleNamestringThe 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
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
ListView
Gets the list view that displays the dropdown items.
[Browsable(false)]
public ListView ListView { get; }
Property Value
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
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 combo view.
[Browsable(false)]
public IList<Widget> Widgets { get; }
Property Value
Methods
ApplyStyle(WidgetStyle)
Applies the specified widget style to this combo view.
protected override void ApplyStyle(WidgetStyle style)
Parameters
styleWidgetStyleThe widget style to apply.
CopyFrom(Widget)
Copies the style and items from another combo view.
protected override void CopyFrom(Widget w)
Parameters
wWidgetThe 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
availableSizePointThe 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
kKeysThe key being pressed.
Events
SelectedIndexChanged
Occurs when the selected item changes.
public event MyraEventHandler SelectedIndexChanged