logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class ModalScrollPolicy

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

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

    Mirrors Serenity.Menu.Domain.Entities.MenuScrollPolicy so modal scrolling behaves identically to menu scrolling.

    Methods

    ShouldScroll(bool, int, int)

    Determines whether a modal 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 modal definition enables scrolling.

    int optionsCount

    Total number of options in the modal.

    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 options and scroll.

    In this article
    © 2026 Serenity. All Rights Reserved