pub struct CreatesCommandBindingViaCommandParameter<C> { /* private fields */ }Expand description
Binds a command to a control of type C that has a Command and a CommandParameter
property (CreatesCommandBindingViaCommandParameter): the binding assigns the parameter, then
the command, and disposing it restores the values the control had.
The affinity is BindingAffinity::EXPLICIT for a control of type C when no event is named,
and zero otherwise: this binder binds no event.
Implementations§
Source§impl<C: 'static> CreatesCommandBindingViaCommandParameter<C>
impl<C: 'static> CreatesCommandBindingViaCommandParameter<C>
Sourcepub fn new(
command: PropertyPath<Rc<C>, Option<Rc<dyn ICommand>>>,
set_command: impl Fn(&C, Option<Rc<dyn ICommand>>) + 'static,
command_parameter: PropertyPath<Rc<C>, CommandParameter>,
set_command_parameter: impl Fn(&C, CommandParameter) + 'static,
) -> Self
pub fn new( command: PropertyPath<Rc<C>, Option<Rc<dyn ICommand>>>, set_command: impl Fn(&C, Option<Rc<dyn ICommand>>) + 'static, command_parameter: PropertyPath<Rc<C>, CommandParameter>, set_command_parameter: impl Fn(&C, CommandParameter) + 'static, ) -> Self
A binder over the Command property (command reads it, set_command assigns it) and the
CommandParameter property of the controls of type C.
Trait Implementations§
Source§impl<C> Debug for CreatesCommandBindingViaCommandParameter<C>
impl<C> Debug for CreatesCommandBindingViaCommandParameter<C>
Source§impl<C: 'static> ICreatesCommandBinding for CreatesCommandBindingViaCommandParameter<C>
impl<C: 'static> ICreatesCommandBinding for CreatesCommandBindingViaCommandParameter<C>
Source§fn bind_command_to_object_event(
&self,
_command: Option<Rc<dyn ICommand>>,
_target: Option<Rc<dyn Any>>,
_command_parameter: Rc<dyn IObservable<CommandParameter>>,
_event_name: &str,
) -> Option<Rc<dyn IDisposable>>
fn bind_command_to_object_event( &self, _command: Option<Rc<dyn ICommand>>, _target: Option<Rc<dyn Any>>, _command_parameter: Rc<dyn IObservable<CommandParameter>>, _event_name: &str, ) -> Option<Rc<dyn IDisposable>>
None: this binder binds no event.
Source§fn bind_command_to_object_with_handlers(
&self,
_command: Option<Rc<dyn ICommand>>,
_target: Option<Rc<dyn Any>>,
_command_parameter: Rc<dyn IObservable<CommandParameter>>,
_subscription: CommandEventSubscription,
) -> Option<Rc<dyn IDisposable>>
fn bind_command_to_object_with_handlers( &self, _command: Option<Rc<dyn ICommand>>, _target: Option<Rc<dyn Any>>, _command_parameter: Rc<dyn IObservable<CommandParameter>>, _subscription: CommandEventSubscription, ) -> Option<Rc<dyn IDisposable>>
None: this binder binds no event.
Source§fn get_affinity_for_object(
&self,
target_type: TypeId,
has_event_target: bool,
) -> i32
fn get_affinity_for_object( &self, target_type: TypeId, has_event_target: bool, ) -> i32
A positive number when this plugin can bind a command to an object of the type
target_type, the highest number winning among the plugins; zero or less when it cannot
(GetAffinityForObject<T>(bool hasEventTarget)). has_event_target says whether the caller
names the event to bind to.Source§fn bind_command_to_object(
&self,
command: Option<Rc<dyn ICommand>>,
target: Option<Rc<dyn Any>>,
command_parameter: Rc<dyn IObservable<CommandParameter>>,
) -> Option<Rc<dyn IDisposable>>
fn bind_command_to_object( &self, command: Option<Rc<dyn ICommand>>, target: Option<Rc<dyn Any>>, command_parameter: Rc<dyn IObservable<CommandParameter>>, ) -> Option<Rc<dyn IDisposable>>
Binds
command to target through the default event of the target (Click, …), executed
with the latest value of command_parameter; None when no binding was made, as for a
missing command (BindCommandToObject<T>). Disposing the result unbinds the command.Auto Trait Implementations§
impl<C> !RefUnwindSafe for CreatesCommandBindingViaCommandParameter<C>
impl<C> !Send for CreatesCommandBindingViaCommandParameter<C>
impl<C> !Sync for CreatesCommandBindingViaCommandParameter<C>
impl<C> !UnwindSafe for CreatesCommandBindingViaCommandParameter<C>
impl<C> Freeze for CreatesCommandBindingViaCommandParameter<C>
impl<C> Unpin for CreatesCommandBindingViaCommandParameter<C>
impl<C> UnsafeUnpin for CreatesCommandBindingViaCommandParameter<C>where
PropertyPath<Rc<C>, Option<Rc<dyn ICommand>>>: UnsafeUnpin,
Rc<dyn Fn(&C, Option<Rc<dyn ICommand>>)>: UnsafeUnpin,
PropertyPath<Rc<C>, Option<Rc<dyn Any>>>: UnsafeUnpin,
Rc<dyn Fn(&C, Option<Rc<dyn Any>>)>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more