logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IMenuInstanceGate

    Narrow runtime port that guarantees a menu's visual instance exists before it is shown.
    Implemented by the menu runtime (e.g. the Unity menu service) so orchestration code — such as the menu transition decorator — can resolve lazily-instantiated menus without taking a dependency on Unity or on the concrete service.

    Namespace: Serenity.Menu.Application.Interfaces.Services
    Assembly: Serenity.Menu.Application.dll
    Syntax
    public interface IMenuInstanceGate
    Remarks

    Deliberately single-method and Unity-free. Do not add other members or expose Unity concepts here.

    Methods

    EnsureMenu(string)

    Ensures the menu identified by menuId has a built, cached visual instance.
    Idempotent: a menu that is already built returns true without rebuilding; a registered lazy menu is built once and cached; an unknown menu id fails loudly.

    Declaration
    bool EnsureMenu(string menuId)
    Parameters
    Type Name Description
    string menuId

    The id of the menu whose visual instance must exist.

    Returns
    Type Description
    bool

    true if the menu instance is available after the call; false if construction failed in a non-fatal (production) context. Unknown menu ids throw.

    In this article
    © 2026 Serenity. All Rights Reserved