pub struct StyledPropertyOptions<T> { /* private fields */ }Expand description
Options for registering a styled or attached property.
Implementations§
Source§impl<T: PropertyValue> StyledPropertyOptions<T>
impl<T: PropertyValue> StyledPropertyOptions<T>
pub fn new(default_value: T) -> Self
Sourcepub fn inherits(self, inherits: bool) -> Self
pub fn inherits(self, inherits: bool) -> Self
Whether the property inherits its value from the parent object.
Sourcepub fn default_binding_mode(self, mode: BindingMode) -> Self
pub fn default_binding_mode(self, mode: BindingMode) -> Self
The default binding mode for the property.
Sourcepub fn validate(self, validate: impl Fn(&T) -> bool + 'static) -> Self
pub fn validate(self, validate: impl Fn(&T) -> bool + 'static) -> Self
A value validation callback. Setting a value for which it returns false is rejected.
Sourcepub fn coerce(self, coerce: impl Fn(&FerroObject, T) -> T + 'static) -> Self
pub fn coerce(self, coerce: impl Fn(&FerroObject, T) -> T + 'static) -> Self
A value coercion callback.
Sourcepub fn enable_data_validation(self, enable: bool) -> Self
pub fn enable_data_validation(self, enable: bool) -> Self
Whether the property is interested in data validation.
Sourcepub fn assign_binding(self, assign_binding: bool) -> Self
pub fn assign_binding(self, assign_binding: bool) -> Self
Whether a binding given for the property in markup is assigned to the
property instead of bound to it; see FerroProperty::assign_binding.
Sourcepub fn notifying(self, notifying: impl Fn(&FerroObject, bool) + 'static) -> Self
pub fn notifying(self, notifying: impl Fn(&FerroObject, bool) + 'static) -> Self
A callback invoked before and after change notifications are raised.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for StyledPropertyOptions<T>
impl<T> !Send for StyledPropertyOptions<T>
impl<T> !Sync for StyledPropertyOptions<T>
impl<T> !UnwindSafe for StyledPropertyOptions<T>
impl<T> Freeze for StyledPropertyOptions<T>
impl<T> Unpin for StyledPropertyOptions<T>
impl<T> UnsafeUnpin for StyledPropertyOptions<T>where
T: UnsafeUnpin,
Option<Box<dyn Fn(&T) -> bool>>: UnsafeUnpin,
Option<Rc<dyn Fn(&FerroObject, T) -> T>>: 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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more