public static class RunicWpfNavigationServiceCollectionExtensions Registers window navigation on the WPF dispatcher.
Methods
AddRunicWpfNavigation
public static IServiceCollection AddRunicWpfNavigation(this IServiceCollection services, Action<RunicWpfNavigationOptions>? configure = null) Adds RunicNavigationServiceCollectionExtensions.AddRunicNavigation, then replaces the model context with one singleton DispatcherModelContext and the navigator with one of RunicWpfNavigationOptions.NavigatorLifetime. With RunicWpfNavigationOptions.MapView or RunicWpfNavigationOptions.UseViewNamingConvention, it also registers a singleton INavigationViewLocator, replacing an earlier one.
Parameters
servicesThe service collection.
configureConfigures the options.
Returns
services.
Exceptions
ArgumentExceptionThe navigator lifetime is
ServiceLifetime.Transient, or it isServiceLifetime.ScopedwithRunicWpfNavigationOptions.CreateEntryScopesset.
Remarks
The package assumes one UI thread. Without a configured RunicWpfNavigationOptions.Dispatcher and without Application.Current, resolving the model context throws InvalidOperationException. Dispose the provider asynchronously after the dispatcher stops; a synchronous dispose starts the navigator's disposal without waiting for it.