FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ReversiblePropertyChange

    struct · ferroui-xaml-interactivity · v0.5.0

    struct ReversiblePropertyChange<TTarget, TValue>
    

    Coordinates reversible, typed property changes across action instances.

    TTarget is the handle of the target (Ref<Button>, Rc<ViewModel>), TValue the type of the value of the property.

    View source

    Members

    new

    fn new(property_name: &str) -> Self
    

    Initializes a new reversible property-change coordinator for the property property_name.

    Panics

    Panics if the name is empty.

    Source

    apply

    fn apply(self: &Self, target: &TTarget, value: TValue, getter: impl Fn(&TTarget) -> TValue + 'static, setter: impl Fn(&TTarget, TValue) -> () + 'static) -> bool
    

    Applies a value while preserving the state required to revert it. getter gets the current property value, setter sets it. Returns true when the reversible value was applied.

    Source

    revert

    fn revert(self: &Self, _setter: impl Fn(&TTarget, TValue) -> ()) -> bool
    

    Reverts the value previously applied by this coordinator. Returns true when an applied value was reverted.

    Source

    property_name

    fn property_name(self: &Self) -> &str
    

    The name of the property.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither

    Availability

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