Class MenuPopup
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Custom-drawn popup menu with check marks, shortcuts, separators, sub-menus, keyboard navigation and scrolling. Usually shown through ShowMenu(IList<MenuItem>, Rect, PopupPlacement, float, Action?).
public class MenuPopup : Popup
- Inheritance
-
MenuPopup
- Inherited Members
Constructors
MenuPopup(IList<MenuItem>)
Creates a menu.
public MenuPopup(IList<MenuItem> items)
Parameters
Properties
HighlightedIndex
Index of the highlighted entry (-1 = none).
public int HighlightedIndex { get; set; }
Property Value
Items
Entries.
public IList<MenuItem> Items { get; }
Property Value
ParentMenu
Menu that opened this sub-menu (null for a root menu).
public MenuPopup? ParentMenu { get; }
Property Value
Methods
MeasureOverride(Size)
Natural size of the content for the available size (margins excluded).
protected override Size MeasureOverride(Size available)
Parameters
availableSize
Returns
OnKeyDown(KeyEventArgs)
Keyboard routed to the popup when CapturesKeyboard is set; Escape closes by default.
protected override void OnKeyDown(KeyEventArgs e)
Parameters
OnMouseDown(MouseEventArgs)
Mouse button pressed over the element (or captured).
protected override void OnMouseDown(MouseEventArgs e)
Parameters
OnMouseLeave()
The mouse left the element.
protected override void OnMouseLeave()
OnMouseMove(MouseEventArgs)
Mouse moved over the element (or captured).
protected override void OnMouseMove(MouseEventArgs e)
Parameters
OnMouseUp(MouseEventArgs)
Mouse button released.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
OnMouseWheel(MouseEventArgs)
Mouse wheel over the element.
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
OnRender(DrawingContext)
Draws the element (below its children).
protected override void OnRender(DrawingContext dc)
Parameters
Events
ItemChosen
Raised on the root menu when an entry is chosen.
public event Action<MenuPopup, MenuItem>? ItemChosen