MenuRow class Core
One command row of a menu-like surface (the filter dialog's chrome, menu entries, chooser rows). Inherent: the hover row and the keyboard focus are the SAME visual (the shared row highlight — the keyboard cursor never invents its own), click and Space/Enter call the SAME endpoint, and a disabled row drops out of the tab order through its Control.EnabledWhen probe. The row's CONTENT (icon, label, submenu arrow) is painted by a delegate — composition stays with the pane, behaviour stays here.
public sealed class MenuRow : Control
- Namespace
- ArionUI.Presentation.Controls
- Package
- ArionUI.Presentation ·
dotnet add package ArionUI.Presentation --prerelease - Inherits
- Control
Constructors
MenuRow
public MenuRow();
Properties
Activate
public required Action<LogRect> Activate { get; init; }The one endpoint — pointer and Space/Enter both call it. Receives the row's rect so a submenu can anchor where the row is.
ActivateOnPress
public bool ActivateOnPress { get; init; }True (default): the row acts on the press, like the filter dialog's chrome always has. False: arm on press, act on release-over (native menus).
Cursor
public override GridCursor Cursor { get; }
DrawContent
public required Action<IRenderSurface, LogRect> DrawContent { get; init; }Paints icon + label + markers into the row. Hover/focus highlight and the focus ring are drawn by the control BEFORE this runs.
DrawsOwnFocus
public override bool DrawsOwnFocus { get; }The control shows its focus itself (accent border, hover row, ring parameter). False = the host draws the shared default ring around Control.Bounds.
Focusable
public override bool Focusable { get; }Can this KIND of control hold the keyboard focus? Combined with the live probes in Control.CanTakeFocus.
Label
public required Func<string> Label { get; init; }
Role
public override ControlRole Role { get; }What KIND of part this is for assistive technology — the automation peers translate it into their host's control type.
Methods
Invoke
public override bool Invoke();Anchors a submenu at the row's box — meaningful only once the pane is arranged, which is the case for every part a peer can see.
OnKey
public override bool OnKey(ArionKey key, ArionModifiers mods);Keys while focused. Return false to let the pane's fallback see the key.
OnPointerPressed
public override void OnPointerPressed(LogPoint p, ArionModifiers mods, int clickCount);
OnPointerReleased
public override void OnPointerReleased(LogPoint p);
Render
public override void Render(IRenderSurface s, ControlFrame frame);
SpokenLabel
public override string? SpokenLabel();What a screen reader speaks when this control receives the focus. A control that cannot take the focus but answers here is READ: it becomes a text part.
