RunicNavigationServiceCollectionExtensions class

Namespace Runic.Navigation in Runic.Navigation 0.23.0

public static class RunicNavigationServiceCollectionExtensions

Registers the window navigator.

Methods

AddRunicNavigation

public static IServiceCollection AddRunicNavigation(this IServiceCollection services)

Adds one IRunicModelContext per service scope, unless one is registered, so the window's content session shares it, and one RunicNavigator per scope built from that context, the scope's provider, the ILoggerFactory and the TimeProvider. Dispose the scope asynchronously; the navigator is disposed before the context it depends on. It also registers NavigationEntryContext so that resolving it from the container, for example as a constructor parameter of a service, throws an InvalidOperationException that explains where it is available: only content the navigator creates receives its entry's context.