Class OAPHCreationHelperMixin
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.dll
A collection of helpers to aid working with observable properties.
- Inheritance
-
OAPHCreation
Helper Mixin
Methods
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, Expression<Func<TObj, TRet>>, out ObservableAsPropertyHelper<TRet>, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, Expression<Func<TObj, TRet>> property, out ObservableAsPropertyHelper<TRet> result, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
Expression<Func<TObj, TRet>>An Expression representing the property (i.e.
x => x.SomeProperty
).result
ObservableAsProperty <TRet>Helper An out param matching the return value, provided for convenience.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, Expression<Func<TObj, TRet>>, out ObservableAsPropertyHelper<TRet>, Func<TRet>, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, Expression<Func<TObj, TRet>> property, out ObservableAsPropertyHelper<TRet> result, Func<TRet> getInitialValue, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
Expression<Func<TObj, TRet>>An Expression representing the property (i.e.
x => x.SomeProperty
).result
ObservableAsProperty <TRet>Helper An out param matching the return value, provided for convenience.
getInitialValue
Func<TRet>The function used to retrieve the initial value of the property.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, Expression<Func<TObj, TRet>>, out ObservableAsPropertyHelper<TRet>, TRet, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, Expression<Func<TObj, TRet>> property, out ObservableAsPropertyHelper<TRet> result, TRet initialValue, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
Expression<Func<TObj, TRet>>An Expression representing the property (i.e.
x => x.SomeProperty
).result
ObservableAsProperty <TRet>Helper An out param matching the return value, provided for convenience.
initialValue
TRetThe initial value of the property.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, Expression<Func<TObj, TRet>>, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, Expression<Func<TObj, TRet>> property, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
Expression<Func<TObj, TRet>>An Expression representing the property (i.e.
x => x.SomeProperty
).deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, Expression<Func<TObj, TRet>>, Func<TRet>, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, Expression<Func<TObj, TRet>> property, Func<TRet> getInitialValue, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
Expression<Func<TObj, TRet>>An Expression representing the property (i.e.
x => x.SomeProperty
).getInitialValue
Func<TRet>The function used to retrieve the initial value of the property.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, Expression<Func<TObj, TRet>>, TRet, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, Expression<Func<TObj, TRet>> property, TRet initialValue, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
Expression<Func<TObj, TRet>>An Expression representing the property (i.e.
x => x.SomeProperty
).initialValue
TRetThe initial value of the property.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, string, out ObservableAsPropertyHelper<TRet>, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, string property, out ObservableAsPropertyHelper<TRet> result, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
stringThe name of the property that has changed. Recommended for use with nameof() or a FODY.
result
ObservableAsProperty <TRet>Helper An out param matching the return value, provided for convenience.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, string, out ObservableAsPropertyHelper<TRet>, Func<TRet>, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, string property, out ObservableAsPropertyHelper<TRet> result, Func<TRet> getInitialValue, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
stringThe name of the property that has changed. Recommended for use with nameof() or a FODY.
result
ObservableAsProperty <TRet>Helper An out param matching the return value, provided for convenience.
getInitialValue
Func<TRet>The function used to retrieve the initial value of the property.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, string, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, string property, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
stringThe name of the property that has changed. Recommended for use with nameof() or a FODY. or a FODY.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, string, Func<TRet>, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, string property, Func<TRet> getInitialValue, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
stringThe name of the property that has changed. Recommended for use with nameof() or a FODY. or a FODY.
getInitialValue
Func<TRet>The function used to retrieve the initial value of the property.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.
ToProperty<TObj, TRet>(IObservable<TRet>, TObj, string, TRet, bool, IScheduler?)
Converts an Observable to an ObservableAsPropertyHelper and automatically provides the onChanged method to raise the property changed notification.
public static ObservableAsPropertyHelper<TRet> ToProperty<TObj, TRet>(this IObservable<TRet> target, TObj source, string property, TRet initialValue, bool deferSubscription = false, IScheduler? scheduler = null) where TObj : class, IReactiveObject
Parameters
target
IObservable<TRet>The observable to convert to an ObservableAsPropertyHelper.
source
TObjThe ReactiveObject that has the property.
property
stringThe name of the property that has changed. Recommended for use with nameof() or a FODY. or a FODY.
initialValue
TRetThe initial value of the property.
deferSubscription
boolA value indicating whether the ObservableAsPropertyHelper<T> should defer the subscription to the
target
source until the first call to Value, or if it should immediately subscribe to thetarget
source.scheduler
ISchedulerThe scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.
Returns
- Observable
AsProperty <TRet>Helper An initialized ObservableAsPropertyHelper; use this as the backing field for your property.
Type Parameters
TObj
The object type.
TRet
The result type.