NE.Standard

Menu

A list of navigation entries, vertical or horizontal, that can collapse to icons alone.

MenuComponent · type key standard.menu · Navigation · property blocks: ICollapsibleComponent, ISelectionStyleComponent

Surface names the fill of the popup the menu opens in — the context menu it is, the split button's list, its sub-entries' flyout — a popup wears the surface colour unless told otherwise. One collection carries entries, captions, rules, checks and selects; IMenuItemModel.Kind selects the template variant. A check's click and a select's option click are the entry click command with the entry's key; the controller answers on the bound item (Checked, Value), so both kinds want a bound collection rather than entries set once.

new MenuComponent("menu")

Properties

PropertyTypeDefaultBindingDescription
Own
Orientation
SetOrientation · BindOrientation
UIOrientation?UIOrientation.Verticalone-wayThe direction the entries run in.
Spacing
SetSpacing · BindSpacing
UIResponsive<double>?2one-wayThe gap between entries, optionally overridden per breakpoint.
Surface
SetSurface · BindSurface
UISurfaceStyle?nullone-wayThe ground the menu paints, unset by default: a menu in a sidebar draws no ground of its own, and one in a popup — the context menu it is, the split button's list, its sub-entries' flyout — wears the popup's surface colour.
Declared here rather than through the property block, whose default (Background) would paint every menu.
Nested
SetNested
bool?falseWhether this menu is the sub-entries of another's entry: it folds and flies out with that entry, and has no sub-entries of its own.
Render-time only: a nested list is built as its entry's block.
Expanded
SetExpanded · BindExpanded
bool?trueone-wayWhether the component is unfolded: the authored start, and what a bound value moves it to; the viewer's own fold stays in the client and may disagree with it afterwards.
Side
SetSide
UISide?UISide.LeftThe edge the component sits on and folds toward, which decides whether width or height collapses.
ShowCollapseToggle
SetShowCollapseToggle
bool?falseWhether the component draws its own switch for ICollapsibleComponent.Expanded.
SelectionStyle
SetSelectionStyle · BindSelectionStyle
UISelectionStyle?nullone-wayWhat a chosen item looks like. Unset, and every unset part of it, is the control's own default.
From ItemsComponentBase
Items
SetItems · BindItems
IReadOnlyList<IMenuItemModel>nullone-wayThe component items.
ItemsView
BindItemsView
UIItemsViewnullone-wayFiltering and sorting rules applied to the items collection.
Query
SetQuery · BindQuery
UIItemsQuerynulltwo-wayThe terms the viewer set after the view compiled — a header's sort, a filter row — applied beside the authored rules; bound both ways, so a windowed source is asked with them and a controller can set them.
From TemplatedComponentBase
TemplateKeyProperty
SetTemplateKeyProperty · BindTemplateKeyProperty
stringnullone-way, relative scopeThe name of the item field whose value selects a named template variant.
FallbackTemplateKey
SetFallbackTemplateKey
stringnullThe fallback template key used when ITemplatedComponent.TemplateKeyProperty does not resolve to a template.

Events

OnItemClick(string command)
Registers a click command invoked when an entry is clicked.
OnItemClickWithItem(string command, string argumentName = "item")
Registers a click command that passes the clicked item as an argument.
OnItemClickWithItemKey(string command, string argumentName = "id")
Registers an entry click command that passes the clicked entry's key as an argument.
OnItemClick(string command, params KeyValuePair<string, UIActionArgument>[] arguments)
Registers a click command invoked when an entry is clicked, with UI action arguments.

Methods

SetTemplate(IButtonComponent visualTemplate)
Sets the item template.
AddTemplateVariant(string key, IButtonComponent visualTemplate)
Adds or replaces a named template variant.
AddItem(IMenuItemModel item)
Adds an item to the component.
AddItems(IEnumerable<IMenuItemModel> items)
Adds items to the component.
FilterBy(UIProperty source, string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, UIComparisonOperator activeOperator = UIComparisonOperator.Required, object activeValue = null)
Adds a filter controlled by a local component property.
Defaults to a case-insensitive substring match; pass the operator explicitly where case matters.
FilterBy(string sourceComponentId, UIProperty source, string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, UIComparisonOperator activeOperator = UIComparisonOperator.Required, object activeValue = null)
Adds a filter controlled by another component property.
FilterBy(UIPropertyReference source, string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, UIComparisonOperator activeOperator = UIComparisonOperator.Required, object activeValue = null)
Adds a filter controlled by a property reference.
FilterBy(string itemProperty, UIComparisonOperator operator = UIComparisonOperator.LikeIgnoreCase, object value = null)
Adds an unconditionally active filter with no source, comparing against a constant value.
SortBy(UIProperty source, string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, UIComparisonOperator activeOperator = UIComparisonOperator.Equal, object activeValue = null, int priority = 0)
Adds a sort rule controlled by a local component property.
SortBy(string sourceComponentId, UIProperty source, string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, UIComparisonOperator activeOperator = UIComparisonOperator.Equal, object activeValue = null, int priority = 0)
Adds a sort rule controlled by another component property.
SortBy(UIPropertyReference source, string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, UIComparisonOperator activeOperator = UIComparisonOperator.Equal, object activeValue = null, int priority = 0)
Adds a sort rule controlled by a property reference.
SortBy(string itemProperty, UIItemsSortDirection direction = UIItemsSortDirection.Ascending, int priority = 0)
Adds an unconditionally active sort rule with no source.
SetEmptyTemplate(IVisualComponent visualTemplate)
Sets the template used when there are no items or no content.
Common properties (16) — layout, visibility, theme, and the rest every component shares
PropertyTypeDefaultBindingDescription
Visibility
SetVisibility · BindVisibility
UIResponsive<UIVisibility>?Visibleone-wayWhat the component does with the room it was given, optionally overridden per breakpoint (e.g. collapsed from a given width up).
Enabled
SetEnabled · BindEnabled
bool?trueone-wayWhether the component responds to input; false dims it and marks it, and its subtree, inert.
Theme
SetTheme · BindTheme
UIThemeMode?nullone-wayThe theme mode forced on this component's subtree, or null to inherit the ambient theme.
HorizontalAlignment
SetHorizontalAlignment · BindHorizontalAlignment
UIAlignment?UIAlignment.Stretchone-wayWhere the component sits within its grid cell along the horizontal axis.
VerticalAlignment
SetVerticalAlignment · BindVerticalAlignment
UIAlignment?UIAlignment.Stretchone-wayWhere the component sits within its grid cell along the vertical axis.
Width
SetWidth · BindWidth
UIResponsive<UILayoutLength>?nullone-wayThe component width, optionally overridden per breakpoint.
MinWidth
SetMinWidth · BindMinWidth
UIResponsive<UILayoutLength>?nullone-wayThe component minimum width, optionally overridden per breakpoint.
MaxWidth
SetMaxWidth · BindMaxWidth
UIResponsive<UILayoutLength>?nullone-wayThe component maximum width, optionally overridden per breakpoint.
Height
SetHeight · BindHeight
UIResponsive<UILayoutLength>?nullone-wayThe component height, optionally overridden per breakpoint.
MinHeight
SetMinHeight · BindMinHeight
UIResponsive<UILayoutLength>?nullone-wayThe component minimum height, optionally overridden per breakpoint.
MaxHeight
SetMaxHeight · BindMaxHeight
UIResponsive<UILayoutLength>?nullone-wayThe component maximum height, optionally overridden per breakpoint.
ZIndex
SetZIndex · BindZIndex
int?0one-wayThe stacking order within the visual tree.
Margin
SetMargin · BindMargin
UIResponsive<UIThickness>?nullone-wayThe outer spacing around the component, optionally overridden per breakpoint.
Placement
SetPlacement · BindPlacement
UIResponsive<UIGridPlacement>?nullone-wayThe grid placement, optionally overridden per breakpoint.
Loading
SetLoading · BindLoading
bool?falseone-wayWhether the component is in loading state — a live state a controller turns on and off.
ShowContextMenu
SetShowContextMenu · BindShowContextMenu
bool?trueone-wayWhether a right-click opens the IVisualComponent.ContextMenu; on a host with rows, whether it opens any row's. Off, the menu stays in the tree and nothing opens it.