NavigationDeparture class

Namespace Runic.Navigation · Runic.Navigation 0.7.0-preview.5

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

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 model turns, so they read and change shared model state through IRunicModelContext.InvokeAsync.

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.