public interface INavigationArrived Runs after the entry became current and the change was presented, outside model turns: on every commit that makes the entry its region's current entry, after INavigationAware.OnNavigatedTo. The request that made the entry current awaits it before it returns Committed.
Remarks
Use it for work that needs the entry presented first, such as loading the page's data while it shows its loading state. It runs after the departed entries retired, and, with a model context that implements IRunicModelPresentationYield (the WPF dispatcher context), after the new view was laid out and rendered. It runs again each time a Back or BackTo resumes the entry, so it must be repeatable.
A hook that throws is logged (event 1076) and gives NavigationArrivalState.Failed with the exception in Committed.ArrivalError; the entry stays current. Its token is cancelled when the entry stops being current (a later commit retains or retires it), when it retires, and when the navigator closes; not when the caller's token is cancelled. Retirement doesn't wait for the hook, so check the token after each await.
The hook may navigate: a request from it is admitted, also into its own region (to redirect with Replace or give up with NavigationEntryContext.BackAsync) and into the regions its content owns, and a region that rejects requests while busy admits them. It must not await RunicNavigator.WhenIdleAsync or its region's NavigationRegion.WhenIdleAsync, which wait for it.
The content is already presented. With an IRunicModelHookScheduler, such as RunicModelContext, the hook runs as its own operation in the model context and sets state directly, also after its awaits. With a context that doesn't schedule hooks, it changes presented state through NavigationEntryContext.ModelContext. An initial target's hook starts after RunicNavigator.CreateRegion or NavigationRegion.Start returned; the region is busy until it ends.
Methods
OnArrivedAsync
ValueTask OnArrivedAsync(NavigationEntryContext entry, NavigationArrival arrival, CancellationToken cancellationToken) Runs after the entry became current and was presented.
Parameters
entryThe entry that became current.
arrivalThe entry and the operation that made it current, as
INavigationAware.OnNavigatedToreceived it.cancellationTokenCancelled when the entry stops being current, retires, or the navigator closes.