Class ReactiveUIBuilder
- Namespace
- ReactiveUI.Builder
- Assembly
- ReactiveUI.dll
A builder class for configuring ReactiveUI without using reflection. This provides an AOT-compatible alternative to the reflection-based InitializeReactiveUI method.
- Inheritance
-
Reactive
UIBuilder
- Extension Methods
Remarks
Initializes a new instance of the Reactive
Constructors
ReactiveUIBuilder(IMutableDependencyResolver)
A builder class for configuring ReactiveUI without using reflection. This provides an AOT-compatible alternative to the reflection-based InitializeReactiveUI method.
Parameters
resolver
IMutableDependency Resolver The dependency resolver to configure.
Remarks
Initializes a new instance of the Reactive
Methods
RegisterSingletonViewForViewModel<TView, TViewModel>(string?)
Registers a view type as a lazy singleton for a specific view model using generics. This avoids reflection and is AOT-friendly.
public AppBuilder RegisterSingletonViewForViewModel<TView, TViewModel>(string? contract = null) where TView : class, IViewFor<TViewModel>, new() where TViewModel : class
Parameters
contract
stringOptional contract.
Returns
- App
Builder The builder instance for method chaining.
Type Parameters
TView
The concrete view type.
TViewModel
The view model type.
RegisterViewForViewModel<TView, TViewModel>(string?)
Registers a view type for a specific view model using generics and a parameterless constructor. This avoids reflection and is AOT-friendly.
public AppBuilder RegisterViewForViewModel<TView, TViewModel>(string? contract = null) where TView : class, IViewFor<TViewModel>, new() where TViewModel : class
Parameters
contract
stringOptional contract.
Returns
- App
Builder The builder instance for method chaining.
Type Parameters
TView
The concrete view type.
TViewModel
The view model type.
WithCoreServices()
Registers the core ReactiveUI services.
Returns
- App
Builder The builder instance for method chaining.
WithPlatformServices()
Registers the platform-specific ReactiveUI services.
Returns
- App
Builder The builder instance for method chaining.
WithViewsFromAssembly(Assembly)
Automatically registers all views that implement IViewFor from the specified assembly.
Parameters
assembly
AssemblyThe assembly to scan for views.
Returns
- App
Builder The builder instance for method chaining.