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
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.
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
actionThe action to run in the commit turn.
Exceptions
InvalidOperationExceptionThe 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.