Class KeyMenuItem
One selectable entry in a KeyMenu.
public record KeyMenuItem : IEquatable<KeyMenuItem>
- Inheritance
-
KeyMenuItem
- Implements
Remarks
Because the key is yours to choose, a key menu is not limited to ten entries - use letters once the digits run out.
Constructors
KeyMenuItem(Keys, string, Action?, Color?)
One selectable entry in a KeyMenu.
public KeyMenuItem(Keys Key, string Text, Action? Action = null, Color? Color = null)
Parameters
KeyKeysThe key that selects this entry while the key menu is open.
TextstringThe label shown for this entry, and shown next to the title once it is selected.
ActionActionInvoked when this entry is selected, after the key menu closes if CloseOnSelect is set.
ColorColor?The optional colour for this entry. If null, the default text colour is used.
Remarks
Because the key is yours to choose, a key menu is not limited to ten entries - use letters once the digits run out.
Properties
Action
Invoked when this entry is selected, after the key menu closes if CloseOnSelect is set.
public Action? Action { get; init; }
Property Value
Color
The optional colour for this entry. If null, the default text colour is used.
public Color? Color { get; init; }
Property Value
Key
The key that selects this entry while the key menu is open.
public Keys Key { get; init; }
Property Value
Text
The label shown for this entry, and shown next to the title once it is selected.
public string Text { get; init; }