logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IMenuSettingsDefinition

    Defines the settings required for a Menu.

    Namespace: Serenity.Menu.Domain.Interfaces
    Assembly: Serenity.Menu.Domain.dll
    Syntax
    public interface IMenuSettingsDefinition : IViewDefinition, IFoundationSettings, IScrollableViewDefinition
    Remarks

    This interface extends IViewDefinition so a menu can be hosted as a child of a composite view, and adds menu-specific configuration properties.

    Properties

    Direction

    Gets the axis along which the menu lays out its options.

    Declaration
    MenuDirection Direction { get; }
    Property Value
    Type Description
    MenuDirection

    The menu layout direction as a MenuDirection.

    Remarks

    VERTICAL stacks options top-to-bottom (the historical behavior); HORIZONTAL places them side by side.

    HorizontalOptionWidth

    Gets the explicit option width (canvas units) used when HorizontalOptionWidthMode is EXPLICIT.

    Declaration
    float HorizontalOptionWidth { get; }
    Property Value
    Type Description
    float

    The explicit horizontal option width as a float.

    HorizontalOptionWidthMode

    Gets how option columns are sized for a horizontal menu.

    Declaration
    HorizontalOptionWidthMode HorizontalOptionWidthMode { get; }
    Property Value
    Type Description
    HorizontalOptionWidthMode

    The horizontal option width mode as a HorizontalOptionWidthMode.

    Remarks

    Only applies when Direction is HORIZONTAL. Controls whether columns keep their content width, share a uniform/capped width, fill the available width, or use an explicit width.

    InstantiationMode

    Gets the configured instantiation mode that controls when this menu's visual instance is created.

    Declaration
    MenuInstantiationMode InstantiationMode { get; }
    Property Value
    Type Description
    MenuInstantiationMode

    The configured MenuInstantiationMode for this menu.

    Remarks

    Configuration-only in this iteration; defaults to PreloadOnStartup and is not yet honored by any runtime code.

    IsTranslatingTitle

    Gets whether the title is being translated.

    Declaration
    bool IsTranslatingTitle { get; }
    Property Value
    Type Description
    bool

    True if the title is being translated; otherwise, false.

    OnCancel

    Gets the signals to dispatch when the cancel input is not consumed by the selected option.

    Declaration
    IReadOnlyList<EventDispatcherSignal> OnCancel { get; }
    Property Value
    Type Description
    IReadOnlyList<EventDispatcherSignal>

    A read-only list of event dispatcher signals fired on an unconsumed cancel.

    Remarks

    Fired alongside the back navigation; when there is no view to go back to, the signals still dispatch.

    OnHide

    Gets the signals to dispatch when the menu is hidden.

    Declaration
    IReadOnlyList<EventDispatcherSignal> OnHide { get; }
    Property Value
    Type Description
    IReadOnlyList<EventDispatcherSignal>

    A read-only list of event dispatcher signals fired on the hide transition.

    OnShow

    Gets the signals to dispatch when the menu is shown.

    Declaration
    IReadOnlyList<EventDispatcherSignal> OnShow { get; }
    Property Value
    Type Description
    IReadOnlyList<EventDispatcherSignal>

    A read-only list of event dispatcher signals fired on the show transition.

    OptionAlignment

    Gets the alignment of the menu options.

    Declaration
    UiComponentAlignmentType OptionAlignment { get; }
    Property Value
    Type Description
    UiComponentAlignmentType

    The alignment of the menu options as a UiComponentAlignmentType.

    Options

    Gets the array of options available in the menu.

    Declaration
    UiOption[] Options { get; }
    Property Value
    Type Description
    UiOption[]

    An array of UiOption representing the options in the menu.

    OptionsGap

    Gets the gap between menu options.

    Declaration
    float OptionsGap { get; }
    Property Value
    Type Description
    float

    The gap between menu options as a float.

    Title

    Gets the title of the menu.

    Declaration
    string Title { get; }
    Property Value
    Type Description
    string

    The title of the menu as a string.

    TitleGap

    Gets the gap between the title and the options.

    Declaration
    float TitleGap { get; }
    Property Value
    Type Description
    float

    The gap between the title and the options as a float.

    ViewAlignment

    Gets the alignment of the view (formerly MenuAlignment).

    Declaration
    UiAnchorType ViewAlignment { get; }
    Property Value
    Type Description
    UiAnchorType

    The alignment of the view as a UiAnchorType.

    VisibleOptionsCount

    Gets the number of options visible at once when the menu is scrollable.

    Declaration
    int VisibleOptionsCount { get; }
    Property Value
    Type Description
    int

    The number of options visible at once as an int.

    Remarks

    When Scrollable is on and the menu has more options than this, the options area clamps to this many rows and the rest scroll. Zero or less disables clamping.

    See Also

    IViewDefinition
    In this article
    © 2026 Serenity. All Rights Reserved