NavigationDeparture class

Namespace Runic.Navigation in Runic.Navigation 0.23.0

public sealed class NavigationDeparture

Describes a departure that a guard can veto. The navigator creates one for each guard invocation; it belongs to that invocation and to the transition that runs it.

Properties

ContentContinues

public bool ContentContinues { get; }

Gets whether the entry retires but its content continues: another entry that this transition doesn't retire holds the same content (NavigationTarget.Share), as when a Replace hands the content over to the next entry. The content is then neither forgotten nor disposed; a guard that protects the content's state, such as LeaveConfirmation, treats the departure like NavigationDepartureKind.Retain.

Entry

public NavigationEntryId Entry { get; }

Gets the departing entry.

Kind

public NavigationDepartureKind Kind { get; }

Gets whether the entry is retained or retired.

ModelContext

public IRunicModelContext ModelContext { get; }

Gets the model context whose turns commit the navigator's state. Guards run outside commit turns. Under a context that schedules hooks (IRunicModelHookScheduler) a guard runs in that context, and IRunicModelContext.InvokeAsync runs inline; otherwise a guard reads and changes shared model state through it.

Operation

public NavigationOperation Operation { get; }

Gets the requested operation.

Methods

OnCommitted

public void OnCommitted(Action action)

Runs action if, and only if, this transition commits: in its commit turn, after the new stacks and entry states are applied and before the regions raise PropertyChanged. Actions run in registration order. An action that throws is logged (event 1072), the commit stands, and the remaining actions still run. When the transition is superseded, rejected, cancelled or fails, its actions are dropped; a guard that runs again registers again.

Parameters

action

The action to run in the commit turn.

Exceptions

InvalidOperationException

The guard's task has already completed.

Remarks

Register only while the guard runs, before its task completes. An action runs inside a model turn, so it must not pump or await navigation. A navigation request it starts is admitted after the commit.

ToString

public override string ToString()

Inherits documentation from Object.ToString.