Skip to content

IReactiveUIBuilder interface

Defined in

Namespace: ReactiveUI.Reactive.Builder Assembly: ReactiveUI.Reactive.dll Full name: ReactiveUI.Reactive.Builder.IReactiveUIBuilder Modifiers: public abstract

Summary

        Fluent builder that configures ReactiveUI platform services, registrations, and schedulers before building an application instance.
        

Applies to

net10.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-tvos26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net10.0-ios26.0, net10.0-android36.0, net9.0, net9.0-tvos18.0, net9.0-macos15.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-ios18.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.5, netstandard2.1, net481, net462, net471

Class hierarchy
classDiagram
class IReactiveUIBuilder
class IAppBuilder {
    <>
}
IAppBuilder <|.. IReactiveUIBuilder

Implements: IAppBuilder

Remarks

The builder wraps Builder primitives so apps can register views, view models, and platform modules using a single fluent API. Most hosts call UseReactiveUI (MAUI) or services.AddReactiveUI() (generic host) internally, which creates an IReactiveUIBuilder and then applies platform-specific extensions.

Examples

<![CDATA[
 builder.UseReactiveUI(config =>
 config
 .WithPlatformServices()
 .RegisterView<LoginView, LoginViewModel>()
 .RegisterSingletonViewModel<AppShellViewModel>()
 .WithRegistration(resolver =>
 {
 resolver.RegisterLazySingleton<IApiClient>(() => new ApiClient());
 })
 .BuildApp());
 ]]>

Methods

NameSummary
WithMessageBusConfigures the message bus.
ConfigureSuspensionDriverConfigures the suspension driver.
ConfigureViewLocatorConfigures the view locator.
ForCustomPlatformFors the custom platform.
ForPlatformsFors the platforms.
RegisterSingletonViewRegisters the singleton view.
RegisterSingletonViewModelRegisters the singleton view model.
RegisterViewRegisters the view.
RegisterViewModelRegisters the view model.
RegisterConstantViewModelRegisters a constant instance of the specified view model type for use in the reactive UI builder.
WithMainThreadSchedulerWithes the main thread scheduler.
WithPlatformModuleWithes the platform module.
WithPlatformServicesWithes the platform services.
WithRegistrationWithes the registration.
WithRegistrationOnBuildWithes the registration on build.
WithTaskPoolSchedulerWithes the task pool scheduler.
WithExceptionHandlerConfigures a custom exception handler for unhandled errors in ReactiveUI observables. If not configured, ReactiveUI uses a default handler that breaks the debugger and throws...
WithSuspensionHostConfigures the non-generic suspension host for application lifecycle management. Creates a default [ISuspensionHost](# instance if not explicitly provided.
WithCacheSizesConfigures custom cache size limits for ReactiveUI's internal memoizing caches. If not configured, platform-specific defaults are used (32/64 for mobile, 64/256 for desktop).
WithConverterRegisters a typed binding converter using the concrete type.
WithFallbackConverterRegisters a fallback binding converter.
WithSetMethodConverterRegisters a set-method binding converter.
WithConvertersFromImports all converters from a Splat dependency resolver into the builder.
WithViewsFromAssemblyWithes the views from assembly.
UsingSplatModuleUsing the splat module.
BuildBuilds the application and returns the ReactiveUI instance wrapper.
BuildAppBuilds the application and returns the ReactiveUI instance wrapper.
WithInstanceResolves a single instance and passes it to the action.

Extension members

See also