ReactiveServiceCollectionExtensions class

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

public static class ReactiveServiceCollectionExtensions

Registers ReactiveUI scheduling for a scoped Runic model graph.

Methods

AddRunicReactiveModelContext

public static IServiceCollection AddRunicReactiveModelContext(this IServiceCollection services)

Adds a scoped model context, the scheduler provider and the command-output scheduler of that context. Existing application registrations are preserved. The scheduler is registered as transient, and the provider returns one scheduler per context, so every resolution for one context gets the same instance. That also holds when the context is a singleton, such as a WPF dispatcher context, and a singleton ViewModel can inject it. The CS-WebUI and Desktop hosts bind a window's root ViewModel to the scoped context; bind independently presented children to it with RunicModelContextRegistry.Bind before exposing them. Dispose the service scope asynchronously to drain its owned context.