logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class MenuScrollPolicy

    Pure decision rule for menu option scrolling: a menu clamps its options area to the configured number of visible rows (and scrolls the rest) only when scrolling is enabled, the visible count is meaningful, and there actually are more options than fit.

    Inheritance
    object
    MenuScrollPolicy
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Menu.Domain.Entities
    Assembly: Serenity.Menu.Domain.dll
    Syntax
    public static class MenuScrollPolicy

    Methods

    ShouldScroll(bool, int, int)

    Determines whether a menu should clamp its options area and scroll the overflow.

    Declaration
    public static bool ShouldScroll(bool scrollable, int optionsCount, int visibleOptionsCount)
    Parameters
    Type Name Description
    bool scrollable

    Whether the menu definition enables scrolling.

    int optionsCount

    Total number of options in the menu.

    int visibleOptionsCount

    Configured number of options visible at once; 0 or less disables clamping.

    Returns
    Type Description
    bool

    True when the options area must clamp to visibleOptionsCount rows and scroll.

    In this article
    © 2026 Serenity. All Rights Reserved