logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class CascadeMenuModel

    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
    object
    CascadeMenuModel
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.Menu.Application.Cascade
    Assembly: Serenity.Menu.Application.dll
    Syntax
    public sealed class CascadeMenuModel

    Constructors

    CascadeMenuModel()

    Declaration
    public CascadeMenuModel()

    Properties

    Current

    Declaration
    public CascadeMenuPage Current { get; }
    Property Value
    Type Description
    CascadeMenuPage

    Depth

    Declaration
    public int Depth { get; }
    Property Value
    Type Description
    int

    FocusColumn

    Declaration
    public int FocusColumn { get; }
    Property Value
    Type Description
    int

    FocusIndex

    Declaration
    public int FocusIndex { get; }
    Property Value
    Type Description
    int

    IsActive

    Declaration
    public bool IsActive { get; }
    Property Value
    Type Description
    bool

    IsBase

    Declaration
    public bool IsBase { get; }
    Property Value
    Type Description
    bool

    Methods

    Cancel()

    Pops to the parent (its prior focus is preserved). Returns false / no-op at the base.

    Declaration
    public bool Cancel()
    Returns
    Type Description
    bool

    Close()

    Declaration
    public void Close()

    ColumnAt(int)

    Declaration
    public int ColumnAt(int level)
    Parameters
    Type Name Description
    int level
    Returns
    Type Description
    int

    CurrentColumn()

    Declaration
    public CascadeColumn CurrentColumn()
    Returns
    Type Description
    CascadeColumn

    FocusedOption()

    Declaration
    public CascadeOption FocusedOption()
    Returns
    Type Description
    CascadeOption

    IndexAt(int)

    Declaration
    public int IndexAt(int level)
    Parameters
    Type Name Description
    int level
    Returns
    Type Description
    int

    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
    Type Description
    bool

    MoveFocus(int)

    Moves the cursor within the focused column (wrapping).

    Declaration
    public void MoveFocus(int delta)
    Parameters
    Type Name Description
    int delta

    Open(CascadeMenuPage)

    Declaration
    public void Open(CascadeMenuPage root)
    Parameters
    Type Name Description
    CascadeMenuPage root

    PageAt(int)

    Declaration
    public CascadeMenuPage PageAt(int level)
    Parameters
    Type Name Description
    int level
    Returns
    Type Description
    CascadeMenuPage

    Push(CascadeMenuPage)

    Declaration
    public void Push(CascadeMenuPage page)
    Parameters
    Type Name Description
    CascadeMenuPage page

    SetFocus(int, int)

    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

    Submit()

    Invokes the focused option's action (if enabled).

    Declaration
    public void Submit()

    Events

    Changed

    Raised on structural changes (open/push/cancel/close).

    Declaration
    public event Action Changed
    Event Type
    Type Description
    Action

    FocusChanged

    Raised when only the cursor moved (focus column/index).

    Declaration
    public event Action FocusChanged
    Event Type
    Type Description
    Action
    In this article
    © 2026 Serenity. All Rights Reserved