logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class CompositeNavWiring

    Pure helpers for the navigation strings the builder writes into generated menus: composite-child transition paths and id sanitization. Centralized so the generator and (later) the composite inspector's child-swap rewrite share one source of truth.

    Inheritance
    object
    CompositeNavWiring
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Ui.Infrastructure.Editor.Builder
    Assembly: Serenity.UnityUi.Infrastructure.Editor.dll
    Syntax
    public static class CompositeNavWiring

    Fields

    GoBack

    The go-back transition sentinel (mirrors MenuConstants.Ids.GO_BACK).

    Declaration
    public const string GoBack = "Menu_GoBack"
    Field Value
    Type Description
    string

    PathSeparator

    Separator joining segments of a composite-child transition path (e.g. "Root::Content::View"). A local copy of MenuConstants.COMPOSITE_CHILD_TARGET_SEPARATOR so this Ui-editor code stays free of a Menu-module dependency (mirrors the composite factory's local separator).

    Declaration
    public const string PathSeparator = "::"
    Field Value
    Type Description
    string

    Methods

    BuildNavbarTargets(string, string, IReadOnlyList<(string label, string viewId)>, bool)

    Builds the navbar's switch targets: one option per content View whose path activates that View in the content switcher, plus a trailing Back option. The paths start at the registered root so the runtime can walk root → content switcher → View.

    Declaration
    public static List<NavTarget> BuildNavbarTargets(string rootId, string contentSwitcherId, IReadOnlyList<(string label, string viewId)> viewLabelsAndIds, bool includeBack = true)
    Parameters
    Type Name Description
    string rootId

    The registered root composite id.

    string contentSwitcherId

    The content switcher composite id (a child of the root).

    IReadOnlyList<(string label, string viewId)> viewLabelsAndIds

    Ordered (label, viewId) pairs, one per content View.

    bool includeBack

    When true, appends a Back option.

    Returns
    Type Description
    List<NavTarget>

    The ordered nav targets.

    BuildPath(params string[])

    Joins composite ids into a transition path the runtime walks segment-by-segment (TryOpenAsDetail). Every segment must be a registered view id, starting at the root.

    Declaration
    public static string BuildPath(params string[] segments)
    Parameters
    Type Name Description
    string[] segments

    Ids from the registered root down to the target child.

    Returns
    Type Description
    string

    The "::"-joined path.

    SanitizeId(string)

    Sanitizes a string into a safe view id: trims, replaces whitespace and the reserved separators (:: path separator and / hosted-instance separator) with underscores, and collapses runs of underscores. Returns "View" for empty input.

    Declaration
    public static string SanitizeId(string raw)
    Parameters
    Type Name Description
    string raw

    The raw name/id to sanitize.

    Returns
    Type Description
    string

    A separator-free id.

    In this article
    © 2026 Serenity. All Rights Reserved