FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    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?)).

    Source

    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).

    Source

    converter_service

    fn converter_service(self: &Self) -> &Rc<ConverterService>
    

    The converter service of the bindings, with its three registries (ConverterService).

    Source

    resolver

    fn resolver(self: &Self) -> Rc<dyn IMutableDependencyResolver>
    

    The resolver the builder registers with (CurrentMutable).

    Source

    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.

    Source

    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)).

    Source

    with_registration

    fn with_registration(self: &Rc<Self>, configure_action: impl FnOnce(&dyn IMutableDependencyResolver) -> ()) -> Rc<Self>
    

    Runs configure_action on the resolver now (WithRegistration).

    Source

    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).

    Source

    with_fallback_converter

    fn with_fallback_converter(self: &Rc<Self>, converter: Rc<dyn IBindingFallbackConverter>) -> Rc<Self>
    

    Registers a fallback converter (WithFallbackConverter).

    Source

    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).

    Source

    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).

    Source

    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).

    Source

    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.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.