Skip to main content

MenuItem Class

Package: GHIElectronics.Endpoint.UI
Namespace: GHIElectronics.Endpoint.UI

Handle to a menu item. For a leaf item (Menu.AddItem) subscribe to MenuItem.Clicked. For a dropdown parent (Menu.AddDropdown) subscribe to MenuItem.ValueChanged and read MenuItem.Selected to find out which sub-item the user picked.

class MenuItem {};

Properties​

Selected​

int32_t Selected() const;

For dropdown items: 0-based index of the sub-item the user picked. Returns -1 if this is a leaf item (no sub-items).

Returns int

Events​

Clicked​

Core::Event<...> Clicked;

Fires when a leaf item is tapped. Runs on the UI thread.

ValueChanged​

Core::Event<...> ValueChanged;

Fires when the user picks a sub-item from a dropdown item. Runs on the UI thread.