pub struct DelayedBinding;Expand description
Provides delayed bindings for elements.
The markup engine applies its bindings in a delayed manner: bindings are only applied when an element has finished initializing. Applying bindings as soon as elements are created would mean that long-form bindings (binding objects whose properties are set one by one after creation) don’t work, as the binding would be applied to the property before the properties of the binding object are set.
Implementations§
Source§impl DelayedBinding
impl DelayedBinding
Sourcepub fn add(
target: &StyledElement,
property: &'static FerroProperty,
binding: Rc<dyn BindingBase>,
)
pub fn add( target: &StyledElement, property: &'static FerroProperty, binding: Rc<dyn BindingBase>, )
Adds a delayed binding to an element: the binding is applied to
property when the element has finished initializing, or immediately
if it already has.
Sourcepub fn add_value(
target: &StyledElement,
property: Rc<dyn IPropertyInfo>,
value: impl Fn(&StyledElement) -> Option<BoxedValue> + 'static,
) -> Result<(), BindingError>
pub fn add_value( target: &StyledElement, property: Rc<dyn IPropertyInfo>, value: impl Fn(&StyledElement) -> Option<BoxedValue> + 'static, ) -> Result<(), BindingError>
Adds a delayed value to an element: value is evaluated and written
to property when the element has finished initializing, or
immediately if it already has.
When the value is written immediately, an error from the property setter is returned (the equivalent of the setter throwing to the caller); when it is written later, the error is logged.
Sourcepub fn apply_bindings(control: &StyledElement)
pub fn apply_bindings(control: &StyledElement)
Applies any delayed bindings to an element.
Auto Trait Implementations§
impl Freeze for DelayedBinding
impl RefUnwindSafe for DelayedBinding
impl Send for DelayedBinding
impl Sync for DelayedBinding
impl Unpin for DelayedBinding
impl UnsafeUnpin for DelayedBinding
impl UnwindSafe for DelayedBinding
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more