logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IViewRouter

    Top-level router that shows a view by id across all registered IViewProviders, regardless of which subsystem owns it (menu, custom view, …). It also knows the application's initial/root view, so the boot path and the return-to-menu-after-gameplay path can show it without assuming it is a menu.

    Inherited Members
    IService.LogService
    Namespace: Serenity.Global.Application.Interfaces
    Assembly: Serenity.Global.Application.dll
    Syntax
    public interface IViewRouter : IService, IFoundationSettings

    Methods

    HideView(string)

    Hides the view with the given id via whichever provider owns it.

    Declaration
    void HideView(string viewId)
    Parameters
    Type Name Description
    string viewId

    The id of the view to hide.

    RegisterProvider(IViewProvider)

    Registers a provider (a subsystem that owns top-level views) consulted when resolving ids.

    Declaration
    void RegisterProvider(IViewProvider provider)
    Parameters
    Type Name Description
    IViewProvider provider

    The provider to add.

    SetInitialViewId(string)

    Sets the id of the initial/root view shown by ShowInitialView().

    Declaration
    void SetInitialViewId(string viewId)
    Parameters
    Type Name Description
    string viewId

    The initial view id (may be a menu or a custom view).

    ShowInitialView()

    Shows the configured initial/root view.

    Declaration
    void ShowInitialView()

    ShowView(string)

    Shows the view with the given id via whichever provider owns it, first hiding the currently shown top-level view (if any and different). This is how navigation "deactivates the current view and activates the target" uniformly for menus and composite custom views.

    Declaration
    void ShowView(string viewId)
    Parameters
    Type Name Description
    string viewId

    The id of the view to show.

    See Also

    IService
    In this article
    © 2026 Serenity. All Rights Reserved