INavigationDepartureGuard interface

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

public interface INavigationDepartureGuard

Can veto a transition that retains or retires an entry.

Methods

CanDepartAsync

ValueTask<bool> CanDepartAsync(NavigationDeparture departure, CancellationToken cancellationToken)

Returns whether the entry may depart. Runs outside model turns. A guard may run again for the same entry: a parent transition that retires an entry's child regions asks the child's guards even when a transition of the child already asked them, so a guard must be repeatable.

Parameters

departure

The departing entry, whether it is retained or retired, and the operation.

cancellationToken

Cancelled when the transition is superseded, cancelled or closed.