FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    empty

    fn empty() -> Rc<Self>
    

    Creates a setter without a property or value.

    Source

    new

    fn new<T: PropertyValue>(property: &'static StyledProperty<T>, value: T) -> Rc<Self>
    

    Creates a setter that sets a styled property to a value.

    Source

    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.

    Source

    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.

    Source

    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).

    Source

    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.

    Source

    with_value

    fn with_value(property: &'static FerroProperty, value: SetterValue) -> Rc<Self>
    

    Creates a setter for a property with the given kind of value.

    Source

    property

    fn property(self: &Self) -> Option<&'static FerroProperty>
    

    The property to set.

    Source

    set_property

    fn set_property(self: &Self, value: Option<&'static FerroProperty>)
    

    Source

    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.

    Source

    set_target

    fn set_target(self: &Self, value: Option<Rc<TargetPropertyPath>>)
    

    Source

    value

    fn value(self: &Self) -> Option<SetterValue>
    

    The property value.

    Source

    set_value

    fn set_value(self: &Self, value: Option<SetterValue>)
    

    Source

    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.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.