RunicNavigatorOptions class

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

public sealed class RunicNavigatorOptions

Configures a RunicNavigator.

Constructors

RunicNavigatorOptions

public RunicNavigatorOptions()

Obsolete. Constructors of types with required members are not supported in this version of your compiler.

Properties

CloseTimeout

public TimeSpan CloseTimeout { get; init; }

How long RunicNavigator.DisposeAsync waits for cancelled transitions, and then for the regions to be cleared in model turns (one deadline shared by all regions). A retiring entry whose initialize hook ignored cancellation is not awaited again after the first wait timed out, so disposal takes about twice this value in the worst case, independent of the number of regions, plus the disposal of the content itself. Defaults to 10 seconds.

CreateEntryScopes

public bool CreateEntryScopes { get; init; }

Creates one IServiceScope from RunicNavigatorOptions.Services for each entry built by a NavigationTarget Create target, including an initial target. The entry's content is constructed from the scope, INavigationEntry.Services returns it, and the scope is disposed after the content when the entry retires. Borrow and Own entries never get one. Requires RunicNavigatorOptions.Services.

Remarks

Turn it on only when RunicNavigatorOptions.Services is the root provider, for example for an application-wide navigator registered as a singleton: then constructor dependencies that are scoped, or disposable transients, live and die with their entry. Leave it off for a navigator resolved from a scope, such as the one RunicNavigationServiceCollectionExtensions.AddRunicNavigation registers. Creating a scope from a scoped provider makes a sibling scope of the root, so the entry's scoped dependencies would silently differ from the navigator's. The navigator can't tell a root provider from a scoped one.

LoggerFactory

public ILoggerFactory? LoggerFactory { get; init; }

Creates the navigator's logger. When omitted, failures are written to Trace.

ModelContext

public required IRunicModelContext ModelContext { get; init; }

The window's model context. Commits run in its turns; owned content is bound to it.

Services

public IServiceProvider? Services { get; init; }

The service provider that constructs created content: NavigationTarget.Create resolves constructor parameters from it, and NavigationTarget.Create factories receive it. With RunicNavigatorOptions.CreateEntryScopes, each created entry uses its own scope of it instead.

TimeProvider

public TimeProvider? TimeProvider { get; init; }

The clock of the close timeout and overrun warnings. Defaults to TimeProvider.System.