Skip to main content

bind_command_to_event

Function bind_command_to_event 

Source
pub fn bind_command_to_event(
    command: Rc<dyn ICommand>,
    command_parameter: &Rc<dyn IObservable<CommandParameter>>,
    subscribe: impl FnOnce(Rc<dyn Fn()>) -> Rc<dyn IDisposable>,
) -> Rc<dyn IDisposable>
Expand description

Executes command with the latest value of command_parameter whenever the event that subscribe adds a handler to is raised, if the command can execute with it; disposing the result removes the handler and ends the subscription of the parameter.