Table of Contents

Class OAPHCreationHelperMixin

Namespace
ReactiveUI
Assembly
ReactiveUI.dll

A collection of helpers to aid working with observable properties.

public static class OAPHCreationHelperMixin : Object
Inheritance
OAPHCreationHelperMixin

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 TObj

The ReactiveObject that has the property.

property Expression<Func<TObj, TRet>>

An Expression representing the property (i.e. x => x.SomeProperty).

result ObservableAsPropertyHelper<TRet>

An out param matching the return value, provided for convenience.

deferSubscription bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The ReactiveObject that has the property.

property Expression<Func<TObj, TRet>>

An Expression representing the property (i.e. x => x.SomeProperty).

result ObservableAsPropertyHelper<TRet>

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 bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The ReactiveObject that has the property.

property Expression<Func<TObj, TRet>>

An Expression representing the property (i.e. x => x.SomeProperty).

result ObservableAsPropertyHelper<TRet>

An out param matching the return value, provided for convenience.

initialValue TRet

The initial value of the property.

deferSubscription bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The ReactiveObject that has the property.

property Expression<Func<TObj, TRet>>

An Expression representing the property (i.e. x => x.SomeProperty).

deferSubscription bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The 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 bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The ReactiveObject that has the property.

property Expression<Func<TObj, TRet>>

An Expression representing the property (i.e. x => x.SomeProperty).

initialValue TRet

The initial value of the property.

deferSubscription bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The ReactiveObject that has the property.

property string

The name of the property that has changed. Recommended for use with nameof() or a FODY.

result ObservableAsPropertyHelper<TRet>

An out param matching the return value, provided for convenience.

deferSubscription bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The ReactiveObject that has the property.

property string

The name of the property that has changed. Recommended for use with nameof() or a FODY.

result ObservableAsPropertyHelper<TRet>

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 bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The ReactiveObject that has the property.

property string

The name of the property that has changed. Recommended for use with nameof() or a FODY. or a FODY.

deferSubscription bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The ReactiveObject that has the property.

property string

The 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 bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

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 TObj

The ReactiveObject that has the property.

property string

The name of the property that has changed. Recommended for use with nameof() or a FODY. or a FODY.

initialValue TRet

The initial value of the property.

deferSubscription bool

A 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 the target source.

scheduler IScheduler

The scheduler that the notifications will be provided on - this should normally be a Dispatcher-based scheduler.

Returns

ObservableAsPropertyHelper<TRet>

An initialized ObservableAsPropertyHelper; use this as the backing field for your property.

Type Parameters

TObj

The object type.

TRet

The result type.