Setter
struct · ferroui-base · v0.5.0
struct Setter
A setter for a Style.
A setter describes what will take place when the requirements for a style are met: it sets a property to a value, binds it to a source of values or sets it to the result of a template.
Members
emptynewnew_untypednew_bindingnew_binding_basenew_templatewith_valuepropertyset_propertytargetset_targetvalueset_valueset_setter_value
empty
fn empty() -> Rc<Self>
Creates a setter without a property or value.
new
fn new<T: PropertyValue>(property: &'static StyledProperty<T>, value: T) -> Rc<Self>
Creates a setter that sets a styled property to a value.
new_untyped
fn new_untyped(property: &'static FerroProperty, value: BoxedValue) -> Rc<Self>
Creates a setter that sets a property to an untyped value, which must hold exactly the property's value type.
new_binding
fn new_binding(property: &'static FerroProperty, source: Rc<dyn IObservable<BoxedValue>>) -> Rc<Self>
Creates a setter that binds a property to a source of values.
new_binding_base
fn new_binding_base(property: &'static FerroProperty, binding: Rc<dyn BindingBase>) -> Rc<Self>
Creates a setter that binds a property with a binding (a compiled, string-path, template or multi binding).
new_template
fn new_template(property: &'static FerroProperty, template: Rc<dyn ITemplate>) -> Rc<Self>
Creates a setter that sets a property to the object built by a template.
with_value
fn with_value(property: &'static FerroProperty, value: SetterValue) -> Rc<Self>
Creates a setter for a property with the given kind of value.
property
fn property(self: &Self) -> Option<&'static FerroProperty>
The property to set.
set_property
fn set_property(self: &Self, value: Option<&'static FerroProperty>)
target
fn target(self: &Self) -> Option<Rc<TargetPropertyPath>>
The target of the setter in a visual state (WinUI's Setter.Target): the object whose
property the setter sets. None (the default) for the setters of
styles, which set the property of the element the style applies to.
An addition (docs/porting/winui-calculator-gaps.md, section 5.2). A style with a setter
that has a target is an error, as Setter.Property in a visual state is in WinUI.
set_target
fn set_target(self: &Self, value: Option<Rc<TargetPropertyPath>>)
value
fn value(self: &Self) -> Option<SetterValue>
The property value.
set_value
fn set_value(self: &Self, value: Option<SetterValue>)
set_setter_value
fn set_setter_value(self: &Self, value: &dyn ISetterValue, boxed: BoxedValue)
Sets a plain value that wants to be notified that it has become a
setter value. boxed is the value as it will be set on the property.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeAnyValueClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyToStringErasedDestructorIntoEitherIAnimationSetterPartialEqDefaultISetterInstanceSetterBaseDisplayMarkupTypedValueTypeRegistration
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.