Class MenuItem
An item contained inside a Menu element.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public class MenuItem : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, INotifyValueChanged<bool>, IPressable
Constructors
Name | Description |
---|---|
MenuItem() | Default constructor. |
Fields
Name | Description |
---|---|
activeUssClassname | The MenuItem active styling class. |
checkmarkUssClassName | The MenuItem checkmark styling class. |
iconUssClassName | The MenuItem icon styling class. |
labelUssClassName | The MenuItem label styling class. |
selectableUssClassname | The MenuItem selectable mode styling class. |
shortcutUssClassName | The MenuItem shortcut styling class. |
subMenuIconUssClassname | The MenuItem submenu icon styling class. |
subMenuItemUssClassname | The MenuItem submenu mode styling class. |
ussClassName | The MenuItem main styling class. |
Properties
Name | Description |
---|---|
active | Enable or disable the active mode of the item. |
clickable | Clickable Manipulator for this MenuItem. |
contentContainer | The content container of the MenuItem. |
hasSubMenu | |
icon | The icon to display next to the label. |
label | The label text value. |
selectable | Enable or disable the selectable mode of the item. A selectable item is an item with a small checkmark as leading UI element. |
shortcut | The shortcut text value. |
subMenu | Sub Menu linked to this item. An item with a submenu mode enabled has a small caret as trailing UI element which defines that a sub menu will appear if you trigger the item's action. |
value | The selected state of the item.
|
Methods
Name | Description |
---|---|
ExecuteDefaultActionAtTarget(EventBase) | Executes logic after the callbacks registered on the event target have executed, unless the event is marked to prevent its default behaviour. EventBase{T}.PreventDefault. |
SetValueWithoutNotify(bool) | Set the selected state of this item. See value and selectable properties for more info. |