Class NotifyPropertyChangedEx
- Namespace
- Dynamic
Data .Binding
- Assembly
- DynamicData.dll
Property changes notification.
- Inheritance
-
Notify
Property Changed Ex
Methods
WhenAnyPropertyChanged<TObject>(TObject, params string[])
Notifies when any property on the object has changed.
public static IObservable<TObject?> WhenAnyPropertyChanged<TObject>(this TObject source, params string[] propertiesToMonitor) where TObject : INotifyPropertyChanged
Parameters
sourceTObjectThe source.
propertiesToMonitorstring[]specify properties to Monitor, or omit to monitor all property changes.
Returns
- IObservable<TObject>
A observable which includes notifying on any property.
Type Parameters
TObjectThe type of the object.
WhenChanged<TObject, TResult, TProperty1>(TObject, Expression<Func<TObject, TProperty1>>, Func<TObject, TProperty1?, TResult>, Func<TProperty1>?)
Produces an observable based on the combined values of the specified properties, including the initial value. ** A fallback value may be specified to ensure a notification is received when a value is unobtainable. For example when observing Parent.Child.Age, if Child is null the value is unobtainable as Age is a struct and cannot be set to Null. For an object like Parent.Child.Sibling, sibling is an object so if Child is null, the value null and obtainable and is returned as null.
public static IObservable<TResult?> WhenChanged<TObject, TResult, TProperty1>(this TObject source, Expression<Func<TObject, TProperty1>> p1, Func<TObject, TProperty1?, TResult> resultSelector, Func<TProperty1>? p1Fallback = null) where TObject : INotifyPropertyChanged
Parameters
sourceTObjectThe source object.
p1Expression<Func<TObject, TProperty1>>An expression to the first property.
resultSelectorFunc<TObject, TProperty1, TResult>A function which will select the result from the properties and the source.
p1FallbackFunc<TProperty1>Provides a fall back value for the first property in case of the property value cannot be obtained.
Returns
- IObservable<TResult>
An observable which emits the results.
Type Parameters
TObjectThe type of the object.
TResultThe type of the result.
TProperty1The type of the first property.
WhenChanged<TObject, TResult, TProperty1, TProperty2>(TObject, Expression<Func<TObject, TProperty1>>, Expression<Func<TObject, TProperty2>>, Func<TObject, TProperty1?, TProperty2?, TResult>, Func<TProperty1>?, Func<TProperty2>?)
Produces an observable based on the combined values of the specified properties, including the initial value. ** A fallback value may be specified to ensure a notification is received when a value is unobtainable. For example when observing Parent.Child.Age, if Child is null the value is unobtainable as Age is a struct and cannot be set to Null. For an object like Parent.Child.Sibling, sibling is an object so if Child is null, the value null and obtainable and is returned as null.
public static IObservable<TResult?> WhenChanged<TObject, TResult, TProperty1, TProperty2>(this TObject source, Expression<Func<TObject, TProperty1>> p1, Expression<Func<TObject, TProperty2>> p2, Func<TObject, TProperty1?, TProperty2?, TResult> resultSelector, Func<TProperty1>? p1Fallback = null, Func<TProperty2>? p2Fallback = null) where TObject : INotifyPropertyChanged
Parameters
sourceTObjectThe source object.
p1Expression<Func<TObject, TProperty1>>An expression to the first property.
p2Expression<Func<TObject, TProperty2>>An expression to the second property.
resultSelectorFunc<TObject, TProperty1, TProperty2, TResult>A function which will select the result from the properties and the source.
p1FallbackFunc<TProperty1>Provides a fall back value for the first property in case of the property value cannot be obtained.
p2FallbackFunc<TProperty2>Provides a fall back value for the second property in case of the property value cannot be obtained.
Returns
- IObservable<TResult>
An observable which emits the results.
Type Parameters
TObjectThe type of the object.
TResultThe type of the result.
TProperty1The type of the first property.
TProperty2The type of the second property.
WhenChanged<TObject, TResult, TProperty1, TProperty2, TProperty3>(TObject, Expression<Func<TObject, TProperty1>>, Expression<Func<TObject, TProperty2>>, Expression<Func<TObject, TProperty3>>, Func<TObject, TProperty1?, TProperty2?, TProperty3?, TResult>, Func<TProperty1>?, Func<TProperty2>?, Func<TProperty3>?)
Produces an observable based on the combined values of the specified properties, including the initial value. ** A fallback value may be specified to ensure a notification is received when a value is unobtainable. For example when observing Parent.Child.Age, if Child is null the value is unobtainable as Age is a struct and cannot be set to Null. For an object like Parent.Child.Sibling, sibling is an object so if Child is null, the value null and obtainable and is returned as null.
public static IObservable<TResult?> WhenChanged<TObject, TResult, TProperty1, TProperty2, TProperty3>(this TObject source, Expression<Func<TObject, TProperty1>> p1, Expression<Func<TObject, TProperty2>> p2, Expression<Func<TObject, TProperty3>> p3, Func<TObject, TProperty1?, TProperty2?, TProperty3?, TResult> resultSelector, Func<TProperty1>? p1Fallback = null, Func<TProperty2>? p2Fallback = null, Func<TProperty3>? p3Fallback = null) where TObject : INotifyPropertyChanged
Parameters
sourceTObjectThe source object.
p1Expression<Func<TObject, TProperty1>>An expression to the first property.
p2Expression<Func<TObject, TProperty2>>An expression to the second property.
p3Expression<Func<TObject, TProperty3>>An expression to the third property.
resultSelectorFunc<TObject, TProperty1, TProperty2, TProperty3, TResult>A function which will select the result from the properties and the source.
p1FallbackFunc<TProperty1>Provides a fall back value for the first property in case of the property value cannot be obtained.
p2FallbackFunc<TProperty2>Provides a fall back value for the second property in case of the property value cannot be obtained.
p3FallbackFunc<TProperty3>Provides a fall back value for the third property in case of the property value cannot be obtained.
Returns
- IObservable<TResult>
An observable which emits the results.
Type Parameters
TObjectThe type of the object.
TResultThe type of the result.
TProperty1The type of the first property.
TProperty2The type of the second property.
TProperty3The type of the third property.
WhenChanged<TObject, TResult, TProperty1, TProperty2, TProperty3, TProperty4>(TObject, Expression<Func<TObject, TProperty1>>, Expression<Func<TObject, TProperty2>>, Expression<Func<TObject, TProperty3>>, Expression<Func<TObject, TProperty4>>, Func<TObject, TProperty1?, TProperty2?, TProperty3?, TProperty4?, TResult>, Func<TProperty1>?, Func<TProperty2>?, Func<TProperty3>?, Func<TProperty4>?)
Produces an observable based on the combined values of the specified properties, including the initial value. ** A fallback value may be specified to ensure a notification is received when a value is unobtainable. For example when observing Parent.Child.Age, if Child is null the value is unobtainable as Age is a struct and cannot be set to Null. For an object like Parent.Child.Sibling, sibling is an object so if Child is null, the value null and obtainable and is returned as null.
public static IObservable<TResult?> WhenChanged<TObject, TResult, TProperty1, TProperty2, TProperty3, TProperty4>(this TObject source, Expression<Func<TObject, TProperty1>> p1, Expression<Func<TObject, TProperty2>> p2, Expression<Func<TObject, TProperty3>> p3, Expression<Func<TObject, TProperty4>> p4, Func<TObject, TProperty1?, TProperty2?, TProperty3?, TProperty4?, TResult> resultSelector, Func<TProperty1>? p1Fallback = null, Func<TProperty2>? p2Fallback = null, Func<TProperty3>? p3Fallback = null, Func<TProperty4>? p4Fallback = null) where TObject : INotifyPropertyChanged
Parameters
sourceTObjectThe source object.
p1Expression<Func<TObject, TProperty1>>An expression to the first property.
p2Expression<Func<TObject, TProperty2>>An expression to the second property.
p3Expression<Func<TObject, TProperty3>>An expression to the third property.
p4Expression<Func<TObject, TProperty4>>An expression to the fourth property.
resultSelectorFunc<TObject, TProperty1, TProperty2, TProperty3, TProperty4, TResult>A function which will select the result from the properties and the source.
p1FallbackFunc<TProperty1>Provides a fall back value for the first property in case of the property value cannot be obtained.
p2FallbackFunc<TProperty2>Provides a fall back value for the second property in case of the property value cannot be obtained.
p3FallbackFunc<TProperty3>Provides a fall back value for the third property in case of the property value cannot be obtained.
p4FallbackFunc<TProperty4>Provides a fall back value for the fourth property in case of the property value cannot be obtained.
Returns
- IObservable<TResult>
An observable which emits the results.
Type Parameters
TObjectThe type of the object.
TResultThe type of the result.
TProperty1The type of the first property.
TProperty2The type of the second property.
TProperty3The type of the third property.
TProperty4The type of the fourth property.
WhenChanged<TObject, TResult, TProperty1, TProperty2, TProperty3, TProperty4, TProperty5>(TObject, Expression<Func<TObject, TProperty1>>, Expression<Func<TObject, TProperty2>>, Expression<Func<TObject, TProperty3>>, Expression<Func<TObject, TProperty4>>, Expression<Func<TObject, TProperty5>>, Func<TObject, TProperty1?, TProperty2?, TProperty3?, TProperty4?, TProperty5?, TResult>, Func<TProperty1>?, Func<TProperty2>?, Func<TProperty3>?, Func<TProperty4>?, Func<TProperty5>?)
Produces an observable based on the combined values of the specified properties, including the initial value. ** A fallback value may be specified to ensure a notification is received when a value is unobtainable. For example when observing Parent.Child.Age, if Child is null the value is unobtainable as Age is a struct and cannot be set to Null. For an object like Parent.Child.Sibling, sibling is an object so if Child is null, the value null and obtainable and is returned as null.
public static IObservable<TResult?> WhenChanged<TObject, TResult, TProperty1, TProperty2, TProperty3, TProperty4, TProperty5>(this TObject source, Expression<Func<TObject, TProperty1>> p1, Expression<Func<TObject, TProperty2>> p2, Expression<Func<TObject, TProperty3>> p3, Expression<Func<TObject, TProperty4>> p4, Expression<Func<TObject, TProperty5>> p5, Func<TObject, TProperty1?, TProperty2?, TProperty3?, TProperty4?, TProperty5?, TResult> resultSelector, Func<TProperty1>? p1Fallback = null, Func<TProperty2>? p2Fallback = null, Func<TProperty3>? p3Fallback = null, Func<TProperty4>? p4Fallback = null, Func<TProperty5>? p5Fallback = null) where TObject : INotifyPropertyChanged
Parameters
sourceTObjectThe source object.
p1Expression<Func<TObject, TProperty1>>An expression to the first property.
p2Expression<Func<TObject, TProperty2>>An expression to the second property.
p3Expression<Func<TObject, TProperty3>>An expression to the third property.
p4Expression<Func<TObject, TProperty4>>An expression to the fourth property.
p5Expression<Func<TObject, TProperty5>>An expression to the fifth property.
resultSelectorFunc<TObject, TProperty1, TProperty2, TProperty3, TProperty4, TProperty5, TResult>A function which will select the result from the properties and the source.
p1FallbackFunc<TProperty1>Provides a fall back value for the first property in case of the property value cannot be obtained.
p2FallbackFunc<TProperty2>Provides a fall back value for the second property in case of the property value cannot be obtained.
p3FallbackFunc<TProperty3>Provides a fall back value for the third property in case of the property value cannot be obtained.
p4FallbackFunc<TProperty4>Provides a fall back value for the fourth property in case of the property value cannot be obtained.
p5FallbackFunc<TProperty5>Provides a fall back value for the fifth property in case of the property value cannot be obtained.
Returns
- IObservable<TResult>
An observable which emits the results.
Type Parameters
TObjectThe type of the object.
TResultThe type of the result.
TProperty1The type of the first property.
TProperty2The type of the second property.
TProperty3The type of the third property.
TProperty4The type of the fourth property.
TProperty5The type of the fifth property.
WhenChanged<TObject, TResult, TProperty1, TProperty2, TProperty3, TProperty4, TProperty5, TProperty6>(TObject, Expression<Func<TObject, TProperty1>>, Expression<Func<TObject, TProperty2>>, Expression<Func<TObject, TProperty3>>, Expression<Func<TObject, TProperty4>>, Expression<Func<TObject, TProperty5>>, Expression<Func<TObject, TProperty6>>, Func<TObject, TProperty1?, TProperty2?, TProperty3?, TProperty4?, TProperty5?, TProperty6?, TResult>, Func<TProperty1>?, Func<TProperty2>?, Func<TProperty3>?, Func<TProperty4>?, Func<TProperty5>?, Func<TProperty6>?)
Produces an observable based on the combined values of the specified properties, including the initial value. ** A fallback value may be specified to ensure a notification is received when a value is unobtainable. For example when observing Parent.Child.Age, if Child is null the value is unobtainable as Age is a struct and cannot be set to Null. For an object like Parent.Child.Sibling, sibling is an object so if Child is null, the value null and obtainable and is returned as null.
public static IObservable<TResult?> WhenChanged<TObject, TResult, TProperty1, TProperty2, TProperty3, TProperty4, TProperty5, TProperty6>(this TObject source, Expression<Func<TObject, TProperty1>> p1, Expression<Func<TObject, TProperty2>> p2, Expression<Func<TObject, TProperty3>> p3, Expression<Func<TObject, TProperty4>> p4, Expression<Func<TObject, TProperty5>> p5, Expression<Func<TObject, TProperty6>> p6, Func<TObject, TProperty1?, TProperty2?, TProperty3?, TProperty4?, TProperty5?, TProperty6?, TResult> resultSelector, Func<TProperty1>? p1Fallback = null, Func<TProperty2>? p2Fallback = null, Func<TProperty3>? p3Fallback = null, Func<TProperty4>? p4Fallback = null, Func<TProperty5>? p5Fallback = null, Func<TProperty6>? p6Fallback = null) where TObject : INotifyPropertyChanged
Parameters
sourceTObjectThe source object.
p1Expression<Func<TObject, TProperty1>>An expression to the first property.
p2Expression<Func<TObject, TProperty2>>An expression to the second property.
p3Expression<Func<TObject, TProperty3>>An expression to the third property.
p4Expression<Func<TObject, TProperty4>>An expression to the fourth property.
p5Expression<Func<TObject, TProperty5>>An expression to the fifth property.
p6Expression<Func<TObject, TProperty6>>An expression to the sixth property.
resultSelectorFunc<TObject, TProperty1, TProperty2, TProperty3, TProperty4, TProperty5, TProperty6, TResult>A function which will select the result from the properties and the source.
p1FallbackFunc<TProperty1>Provides a fall back value for the first property in case of the property value cannot be obtained.
p2FallbackFunc<TProperty2>Provides a fall back value for the second property in case of the property value cannot be obtained.
p3FallbackFunc<TProperty3>Provides a fall back value for the third property in case of the property value cannot be obtained.
p4FallbackFunc<TProperty4>Provides a fall back value for the fourth property in case of the property value cannot be obtained.
p5FallbackFunc<TProperty5>Provides a fall back value for the fifth property in case of the property value cannot be obtained.
p6FallbackFunc<TProperty6>Provides a fall back value for the sixth property in case of the property value cannot be obtained.
Returns
- IObservable<TResult>
An observable which emits the results.
Type Parameters
TObjectThe type of the object.
TResultThe type of the result.
TProperty1The type of the first property.
TProperty2The type of the second property.
TProperty3The type of the third property.
TProperty4The type of the fourth property.
TProperty5The type of the fifth property.
TProperty6The type of the sixth property.
WhenPropertyChanged<TObject, TProperty>(TObject, Expression<Func<TObject, TProperty>>, bool, Func<TProperty?>?)
Observes property changes for the specified property, starting with the current value.
public static IObservable<PropertyValue<TObject, TProperty>> WhenPropertyChanged<TObject, TProperty>(this TObject source, Expression<Func<TObject, TProperty>> propertyAccessor, bool notifyOnInitialValue = true, Func<TProperty?>? fallbackValue = null) where TObject : INotifyPropertyChanged
Parameters
sourceTObjectThe source.
propertyAccessorExpression<Func<TObject, TProperty>>The property to observe.
notifyOnInitialValueboolIf true the resulting observable includes the initial value.
fallbackValueFunc<TProperty>A fallback value may be specified to ensure a notification is received when a value is unobtainable. For example when observing Parent.Child.Age, if Child is null the value is unobtainable as Age is a struct and cannot be set to Null. For an object like Parent.Child.Sibling, sibling is an object so if Child is null, the value null and obtainable and is returned as null.
Returns
- IObservable<Property
Value <TObject, TProperty>> A observable which also notifies when the property value changes.
Type Parameters
TObjectThe type of the object.
TPropertyThe type of the value.
Exceptions
- Argument
Null Exception propertyAccessor.
WhenValueChanged<TObject, TProperty>(TObject, Expression<Func<TObject, TProperty>>, bool, Func<TProperty>?)
Observes property changes for the specified property, starting with the current value.
public static IObservable<TProperty?> WhenValueChanged<TObject, TProperty>(this TObject source, Expression<Func<TObject, TProperty>> propertyAccessor, bool notifyOnInitialValue = true, Func<TProperty>? fallbackValue = null) where TObject : INotifyPropertyChanged
Parameters
sourceTObjectThe source.
propertyAccessorExpression<Func<TObject, TProperty>>The property to observe.
notifyOnInitialValueboolIf true the resulting observable includes the initial value.
fallbackValueFunc<TProperty>A fallback value may be specified to ensure a notification is received when a value is unobtainable. For example when observing Parent.Child.Age, if Child is null the value is unobtainable as Age is a struct and cannot be set to Null. For an object like Parent.Child.Sibling, sibling is an object so if Child is null, the value null and obtainable and is returned as null.
Returns
- IObservable<TProperty>
An observable which emits the results.
Type Parameters
TObjectThe type of the object.
TPropertyThe type of the first property.