Runtime-configurable navigable cascade menu. The whole stack stays "open": a renderer draws every level
(each offset from its parent — see CascadeMenuPage), while only the top level is
interactable. Up/down moves within the focused column; left/right moves between columns of a multi-column
page (e.g. enemies⇄party, both visible); selecting descends or resolves; Cancel() pops to the
parent (restoring its prior focus) and is a no-op at the base. Pure C# and engine-agnostic, so it is
unit-testable. Renderers listen to Changed (structural — rebuild) and FocusChanged
(cursor moved — re-tint only).
Inheritance
CascadeMenuModel
Assembly: Serenity.Menu.Application.dll
public sealed class CascadeMenuModel
Constructors
Declaration
public CascadeMenuModel()
Properties
Declaration
public CascadeMenuPage Current { get; }
Property Value
Declaration
public int Depth { get; }
Property Value
FocusColumn
Declaration
public int FocusColumn { get; }
Property Value
Declaration
public int FocusIndex { get; }
Property Value
Declaration
public bool IsActive { get; }
Property Value
Declaration
public bool IsBase { get; }
Property Value
Methods
Pops to the parent (its prior focus is preserved). Returns false / no-op at the base.
Declaration
Returns
Declaration
ColumnAt(int)
Declaration
public int ColumnAt(int level)
Parameters
| Type |
Name |
Description |
| int |
level |
|
Returns
CurrentColumn()
Declaration
public CascadeColumn CurrentColumn()
Returns
Declaration
public CascadeOption FocusedOption()
Returns
Declaration
public int IndexAt(int level)
Parameters
| Type |
Name |
Description |
| int |
level |
|
Returns
MoveColumn(int)
Moves the cursor between columns of the current (multi-column) page. Returns true if it moved.
Declaration
public bool MoveColumn(int delta)
Parameters
| Type |
Name |
Description |
| int |
delta |
|
Returns
Moves the cursor within the focused column (wrapping).
Declaration
public void MoveFocus(int delta)
Parameters
| Type |
Name |
Description |
| int |
delta |
|
Declaration
public void Open(CascadeMenuPage root)
Parameters
Declaration
public CascadeMenuPage PageAt(int level)
Parameters
| Type |
Name |
Description |
| int |
level |
|
Returns
Declaration
public void Push(CascadeMenuPage page)
Parameters
Sets the cursor to a specific (column, option). Used for mouse hover/click.
Declaration
public void SetFocus(int column, int index)
Parameters
| Type |
Name |
Description |
| int |
column |
|
| int |
index |
|
Invokes the focused option's action (if enabled).
Declaration
Events
Raised on structural changes (open/push/cancel/close).
Declaration
public event Action Changed
Event Type
Raised when only the cursor moved (focus column/index).
Declaration
public event Action FocusChanged
Event Type