Table of Contents

Method NavigateAsync

Namespace
Velvet
Assembly
Velvet.Docs.dll

NavigateAsync(string, NavigationMode, CancellationToken)

Navigates to the given path. Evaluation order is Guard -> Blocker -> Loader. A successful Guard redirect records the final target rather than intermediate targets while preserving the originating navigation's history effect. A chain of more than five redirects ends the navigation with Error.

public VelvetTask<NavigationResult> NavigateAsync(string path, NavigationMode mode = NavigationMode.Push, CancellationToken cancellationToken = default)

Parameters

path string

Target path to navigate to.

mode NavigationMode

How the destination is recorded in the history stack. Defaults to Push.

cancellationToken CancellationToken

Token forwarded to Blockers and Loaders.

Returns

VelvetTask<NavigationResult>

A NavigationResult indicating the outcome: Success on completion, NotFound when no route matches, Blocked when a Blocker rejects the attempt, Cancelled when concurrent navigation or the cancellation token aborts it, or when mode is Back / Forward and the history has no entry to step onto, or Error on Loader failure or redirect overflow.

NavigateAsync(string, NavigationMode, int, CancellationToken)

Navigates with relative resolution anchored to a specific matched-route level (baseRouteIndex), so a .. is interpreted relative to the route the caller is rendered in rather than the leaf route. UseNavigate/V.Navigate pass the caller's Outlet depth here so a relative target anchors at the caller's route level; -1 falls back to the leaf route.

public VelvetTask<NavigationResult> NavigateAsync(string path, NavigationMode mode, int baseRouteIndex, CancellationToken cancellationToken = default)

Parameters

path string
mode NavigationMode
baseRouteIndex int
cancellationToken CancellationToken

Returns

VelvetTask<NavigationResult>