Skip to main content

NotifyPropertyChangedEx

Trait NotifyPropertyChangedEx 

Source
pub trait NotifyPropertyChangedEx: Clone + 'static {
Show 19 methods // Required method fn when_any_property_changed( &self, properties_to_monitor: &[&str], ) -> Rc<dyn IObservable<Self>>; // Provided methods fn when_property_changed<P: IntoPropertyChain<Self>>( &self, property_accessor: P, ) -> Rc<dyn IObservable<PropertyValue<Self, P::Value>>> where P::Value: 'static { ... } fn when_property_changed_with<P: IntoPropertyChain<Self>>( &self, property_accessor: P, notify_on_initial_value: bool, ) -> Rc<dyn IObservable<PropertyValue<Self, P::Value>>> where P::Value: 'static { ... } fn when_property_changed_with_fallback<P: IntoPropertyChain<Self>>( &self, property_accessor: P, notify_on_initial_value: bool, _fallback_value: impl Fn() -> P::Value + 'static, ) -> Rc<dyn IObservable<PropertyValue<Self, P::Value>>> where P::Value: 'static { ... } fn when_value_changed<P: IntoPropertyChain<Self>>( &self, property_accessor: P, ) -> Rc<dyn IObservable<P::Value>> where P::Value: 'static { ... } fn when_value_changed_with<P: IntoPropertyChain<Self>>( &self, property_accessor: P, notify_on_initial_value: bool, ) -> Rc<dyn IObservable<P::Value>> where P::Value: 'static { ... } fn when_value_changed_with_fallback<P: IntoPropertyChain<Self>>( &self, property_accessor: P, notify_on_initial_value: bool, fallback_value: impl Fn() -> P::Value + 'static, ) -> Rc<dyn IObservable<P::Value>> where P::Value: 'static { ... } fn when_changed<P1: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, result_selector: impl Fn(&Self, P1::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static { ... } fn when_changed_with<P1: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, result_selector: impl Fn(&Self, P1::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static { ... } fn when_changed2<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, result_selector: impl Fn(&Self, P1::Value, P2::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static { ... } fn when_changed2_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, result_selector: impl Fn(&Self, P1::Value, P2::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static { ... } fn when_changed3<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static { ... } fn when_changed3_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, p3_fallback: Fallback<P3::Value>, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static { ... } fn when_changed4<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static { ... } fn when_changed4_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, p3_fallback: Fallback<P3::Value>, p4_fallback: Fallback<P4::Value>, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static { ... } fn when_changed5<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, P5: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value, P5::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static, P5::Value: Clone + 'static { ... } fn when_changed5_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, P5: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value, P5::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, p3_fallback: Fallback<P3::Value>, p4_fallback: Fallback<P4::Value>, p5_fallback: Fallback<P5::Value>, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static, P5::Value: Clone + 'static { ... } fn when_changed6<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, P5: IntoPropertyChain<Self>, P6: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value, P5::Value, P6::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static, P5::Value: Clone + 'static, P6::Value: Clone + 'static { ... } fn when_changed6_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, P5: IntoPropertyChain<Self>, P6: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value, P5::Value, P6::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, p3_fallback: Fallback<P3::Value>, p4_fallback: Fallback<P4::Value>, p5_fallback: Fallback<P5::Value>, p6_fallback: Fallback<P6::Value>, ) -> Rc<dyn IObservable<R>> where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static, P5::Value: Clone + 'static, P6::Value: Clone + 'static { ... }
}
Expand description

The observation of the properties of an object that raises PropertyChanged (NotifyPropertyChangedEx), implemented for the objects held in Rc (upstream’s classes).

The paths are PropertyPaths from prop!, or PropertyChains when a step may be null. Upstream’s optional parameters become methods of their own: _with takes notify_on_initial_value, and _with_fallback the fallback value too.

Required Methods§

Source

fn when_any_property_changed( &self, properties_to_monitor: &[&str], ) -> Rc<dyn IObservable<Self>>

The object, whenever one of properties_to_monitor changes, or any property when none is given (WhenAnyPropertyChanged(params string[] propertiesToMonitor)).

Provided Methods§

Source

fn when_property_changed<P: IntoPropertyChain<Self>>( &self, property_accessor: P, ) -> Rc<dyn IObservable<PropertyValue<Self, P::Value>>>
where P::Value: 'static,

The changes of the property of property_accessor, as the object with the value, the current value first; nothing while a null step interrupts the path (WhenPropertyChanged(Expression<Func<TObject, TProperty>>, bool notifyOnInitialValue = true)).

Source

fn when_property_changed_with<P: IntoPropertyChain<Self>>( &self, property_accessor: P, notify_on_initial_value: bool, ) -> Rc<dyn IObservable<PropertyValue<Self, P::Value>>>
where P::Value: 'static,

when_property_changed that starts with the current value only when notify_on_initial_value is true (WhenPropertyChanged(Expression<Func<TObject, TProperty>>, bool notifyOnInitialValue)).

Source

fn when_property_changed_with_fallback<P: IntoPropertyChain<Self>>( &self, property_accessor: P, notify_on_initial_value: bool, _fallback_value: impl Fn() -> P::Value + 'static, ) -> Rc<dyn IObservable<PropertyValue<Self, P::Value>>>
where P::Value: 'static,

when_property_changed_with with a fallback value: the values that a null step interrupts pass too, without a value (WhenPropertyChanged(Expression<Func<TObject, TProperty>>, bool, Func<TProperty?>? fallbackValue)).

As upstream, the fallback is not called: its presence lets the unobtainable values through.

Source

fn when_value_changed<P: IntoPropertyChain<Self>>( &self, property_accessor: P, ) -> Rc<dyn IObservable<P::Value>>
where P::Value: 'static,

The values of the property of property_accessor, the current value first; nothing while a null step interrupts the path (WhenValueChanged(Expression<Func<TObject, TProperty>>, bool notifyOnInitialValue = true)).

Source

fn when_value_changed_with<P: IntoPropertyChain<Self>>( &self, property_accessor: P, notify_on_initial_value: bool, ) -> Rc<dyn IObservable<P::Value>>
where P::Value: 'static,

when_value_changed that starts with the current value only when notify_on_initial_value is true (WhenValueChanged(Expression<Func<TObject, TProperty>>, bool notifyOnInitialValue)).

Source

fn when_value_changed_with_fallback<P: IntoPropertyChain<Self>>( &self, property_accessor: P, notify_on_initial_value: bool, fallback_value: impl Fn() -> P::Value + 'static, ) -> Rc<dyn IObservable<P::Value>>
where P::Value: 'static,

when_value_changed_with with fallback_value for the values that a null step interrupts (WhenValueChanged(Expression<Func<TObject, TProperty>>, bool, Func<TProperty>? fallbackValue)).

Source

fn when_changed<P1: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, result_selector: impl Fn(&Self, P1::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static,

The value of p1 with the object, through result_selector, the current one first (WhenChanged(Expression<Func<TObject, TProperty1>>, Func<TObject, TProperty1?, TResult>)).

Source

fn when_changed_with<P1: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, result_selector: impl Fn(&Self, P1::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static,

when_changed with a fallback value for the values that a null step interrupts, which are dropped without one (WhenChanged(.., Func<TProperty1>? p1Fallback)).

Source

fn when_changed2<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, result_selector: impl Fn(&Self, P1::Value, P2::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static,

The latest values of p1 and p2 with the object, through result_selector, whenever one changes (WhenChanged of two properties).

Source

fn when_changed2_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, result_selector: impl Fn(&Self, P1::Value, P2::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static,

when_changed2 with fallback values (WhenChanged of two properties, with p1Fallback and p2Fallback).

Source

fn when_changed3<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static,

The latest values of three properties with the object, through result_selector (WhenChanged of three properties).

Source

fn when_changed3_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, p3_fallback: Fallback<P3::Value>, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static,

when_changed3 with fallback values.

Source

fn when_changed4<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static,

The latest values of four properties with the object, through result_selector (WhenChanged of four properties).

Source

fn when_changed4_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, p3_fallback: Fallback<P3::Value>, p4_fallback: Fallback<P4::Value>, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static,

when_changed4 with fallback values.

Source

fn when_changed5<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, P5: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value, P5::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static, P5::Value: Clone + 'static,

The latest values of five properties with the object, through result_selector (WhenChanged of five properties).

Source

fn when_changed5_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, P5: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value, P5::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, p3_fallback: Fallback<P3::Value>, p4_fallback: Fallback<P4::Value>, p5_fallback: Fallback<P5::Value>, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static, P5::Value: Clone + 'static,

when_changed5 with fallback values.

Source

fn when_changed6<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, P5: IntoPropertyChain<Self>, P6: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value, P5::Value, P6::Value) -> R + 'static, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static, P5::Value: Clone + 'static, P6::Value: Clone + 'static,

The latest values of six properties with the object, through result_selector (WhenChanged of six properties).

Source

fn when_changed6_with<P1: IntoPropertyChain<Self>, P2: IntoPropertyChain<Self>, P3: IntoPropertyChain<Self>, P4: IntoPropertyChain<Self>, P5: IntoPropertyChain<Self>, P6: IntoPropertyChain<Self>, R: 'static>( &self, p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, result_selector: impl Fn(&Self, P1::Value, P2::Value, P3::Value, P4::Value, P5::Value, P6::Value) -> R + 'static, p1_fallback: Fallback<P1::Value>, p2_fallback: Fallback<P2::Value>, p3_fallback: Fallback<P3::Value>, p4_fallback: Fallback<P4::Value>, p5_fallback: Fallback<P5::Value>, p6_fallback: Fallback<P6::Value>, ) -> Rc<dyn IObservable<R>>
where P1::Value: Clone + 'static, P2::Value: Clone + 'static, P3::Value: Clone + 'static, P4::Value: Clone + 'static, P5::Value: Clone + 'static, P6::Value: Clone + 'static,

when_changed6 with fallback values.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<M: INotifyPropertyChanged + 'static> NotifyPropertyChangedEx for Rc<M>

Source§

fn when_any_property_changed( &self, properties_to_monitor: &[&str], ) -> Rc<dyn IObservable<Self>>

Implementors§