Class MenuItemNode
Menu Item Node
public class MenuItemNode : ControlNode
- Inheritance
-
MenuItemNode
- Inherited Members
- Extension Methods
Constructors
MenuItemNode(string, Texture, SizeF, Font, bool)
Create Menu Item
public MenuItemNode(string text, Texture iconTexture, SizeF size, Font menuFont, bool hasSubItems = false)
Parameters
Properties
DisabledColor
Color when item is disabled
public Color DisabledColor { get; set; }
Property Value
HoverColor
Color when item is hovered
public Color HoverColor { get; set; }
Property Value
HoverSelectedColor
Color when item is hovered and selected
public Color HoverSelectedColor { get; set; }
Property Value
IsSelected
Whether this item is currently selected by its parent menu
public bool IsSelected { get; set; }
Property Value
NormalColor
Color when item is in normal state
public Color NormalColor { get; set; }
Property Value
PressedColor
Color when item is pressed
public Color PressedColor { get; set; }
Property Value
SelectedColor
Color when item is selected
public Color SelectedColor { get; set; }
Property Value
Text
Menu item text
public string Text { get; set; }
Property Value
Methods
OnClick(MouseEventArgs)
Node override to fire Activated on left-click
public override void OnClick(MouseEventArgs args)
Parameters
argsMouseEventArgs
OnStateChanged()
Updates text color based on control state (normal, hovered, pressed, selected). Called automatically by base class when State property changes.
protected override void OnStateChanged()
OnTouchUpInside(TouchEventArgs)
Node override to fire Activated on touch-up
public override void OnTouchUpInside(TouchEventArgs args)
Parameters
argsTouchEventArgs
Events
Activated
Fired when the item is activated (clicked or tapped)
public event EventHandler Activated