ReactiveUIBindingBuilder
struct · ferroui-reactiveui · v0.5.0
struct ReactiveUIBindingBuilder
The builder of ReactiveUI.Binding (ReactiveUIBindingBuilder): it configures the services of
the property observation and the bindings, the converters and the platform modules on a Splat
AppBuilder, and is the application it builds.
The builder is shared as an Rc; its methods take self: &Rc<Self> and return the builder, to
chain the calls:
use ferroui_reactiveui::{RxBindingBuilder, ViewLocator};
RxBindingBuilder::reset_for_testing();
RxBindingBuilder::create_reactive_ui_binding_builder().with_core_services().build_app();
let _locator = ViewLocator::current();
Deviation (DEVIATIONS.md, ReactiveUI): upstream subclasses AppBuilder and overrides
WithCoreServices; here the builder wraps one and implements IAppBuilder, adding its core
services before it builds the inner builder. The overloads of upstream's methods are the
methods of the builder (self: &Rc<Self>, returning the builder) and those of
IReactiveUIBindingBuilder (object safe); the null checks of the arguments have no
counterpart.
Members
newfindconverter_serviceresolverwith_core_serviceswith_platform_modulewith_registrationwith_converterwith_fallback_converterwith_set_method_converterwith_command_binderconfigure_view_locatorbuild_app
new
fn new(resolver: Rc<dyn IMutableDependencyResolver>, current: Option<Rc<dyn IReadonlyDependencyResolver>>) -> Rc<Self>
A builder over resolver, reading the configured services from current; it initializes
Splat on the resolver and registers its ConverterService there
(ReactiveUIBindingBuilder(IMutableDependencyResolver, IReadonlyDependencyResolver?)).
find
fn find(app_builder: &dyn IAppBuilder) -> Option<Rc<ReactiveUIBindingBuilder>>
The builder behind app_builder, when it is a ReactiveUIBindingBuilder (upstream's
appBuilder is IReactiveUIBindingBuilder).
converter_service
fn converter_service(self: &Self) -> &Rc<ConverterService>
The converter service of the bindings, with its three registries (ConverterService).
resolver
fn resolver(self: &Self) -> Rc<dyn IMutableDependencyResolver>
The resolver the builder registers with (CurrentMutable).
with_core_services
fn with_core_services(self: &Rc<Self>) -> Rc<Self>
Registers the core services once (WithCoreServices): the default converters, the
observers of PropertyChanged and of plain objects (ReactiveUIBindingModule), and a
DefaultViewLocator as the dyn IViewLocator. A second call registers nothing.
with_platform_module
fn with_platform_module<M: IModule + 'static>(self: &Rc<Self>, module: M) -> Rc<Self>
Adds the module of a platform, applied at build time (WithPlatformModule<T>(T)).
with_registration
fn with_registration(self: &Rc<Self>, configure_action: impl FnOnce(&dyn IMutableDependencyResolver) -> ()) -> Rc<Self>
Runs configure_action on the resolver now (WithRegistration).
with_converter
fn with_converter(self: &Rc<Self>, converter: Rc<dyn IBindingTypeConverter>) -> Rc<Self>
Registers a converter of a pair of types in the typed registry (WithConverter).
with_fallback_converter
fn with_fallback_converter(self: &Rc<Self>, converter: Rc<dyn IBindingFallbackConverter>) -> Rc<Self>
Registers a fallback converter (WithFallbackConverter).
with_set_method_converter
fn with_set_method_converter(self: &Rc<Self>, converter: Rc<dyn ISetMethodBindingConverter>) -> Rc<Self>
Registers a converter of set methods (WithSetMethodConverter).
with_command_binder
fn with_command_binder(self: &Rc<Self>, binder: Rc<dyn ICreatesCommandBinding>) -> Rc<Self>
Registers binder, a binder of commands to controls, as a lazy singleton of
dyn ICreatesCommandBinding (WithCommandBinder).
configure_view_locator
fn configure_view_locator(self: &Rc<Self>, configure: impl FnOnce(&ViewMappingBuilder<'_>) -> ()) -> Rc<Self>
Creates a DefaultViewLocator with the mappings configure adds, and registers it as the
dyn IViewLocator (ConfigureViewLocator).
build_app
fn build_app(self: &Rc<Self>) -> Rc<dyn IReactiveUIBindingInstance>
Builds the application, publishes the ConverterService through BindingConverters and
marks ReactiveUI.Binding initialized (BuildApp). It panics with an
InvalidOperationException message when the build gives no resolver.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyDebugIAppInstanceIReactiveUIBindingInstanceIAppBuilderIReactiveUIBindingBuilder
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.