Class ReactiveExtensions
Inheritance
Inherited Members
Namespace: NodeNetwork.Utilities
Assembly: NodeNetwork.dll
Syntax
public static class ReactiveExtensions
Methods
| Improve this Doc View SourceBindList<TView, TViewModel, TData, TProperty>(TView, TViewModel, Expression<Func<TViewModel, IObservableList<TData>>>, Expression<Func<TView, TProperty>>)
Create a one way list binding from the viewmodel to the view. The view list property will be automatically updated to reflect the viewmodel source list property.
Declaration
public static IDisposable BindList<TView, TViewModel, TData, TProperty>(this TView self, TViewModel vmDummy, Expression<Func<TViewModel, IObservableList<TData>>> vmProperty, Expression<Func<TView, TProperty>> viewProperty)
where TView : class, IViewFor<TViewModel> where TViewModel : class
Parameters
Type | Name | Description |
---|---|---|
TView | self | The view used for the binding |
TViewModel | vmDummy | A dummy viewmodel parameter, used to infer the viewmodel type |
System.Linq.Expressions.Expression<System.Func<TViewModel, DynamicData.IObservableList<TData>>> | vmProperty | The source property in the viewmodel that contains the list |
System.Linq.Expressions.Expression<System.Func<TView, TProperty>> | viewProperty | The target property in the view to bind the list to. |
Returns
Type | Description |
---|---|
System.IDisposable | An object that when disposed, disconnects the binding. |
Type Parameters
Name | Description |
---|---|
TView | The type of the view |
TViewModel | The type of the viewmodel |
TData | The type of the data stored in the list |
TProperty | The type of the target property in the view |
PairWithPreviousValue<T>(IObservable<T>)
Takes an observable of T values and returns an observable of tuples of T values containing the latest value and the previous value. The first item in the source observable produces a tuple with the previous value set to default(T).
Declaration
public static IObservable<(T OldValue, T NewValue)> PairWithPreviousValue<T>(this IObservable<T> obs)
Parameters
Type | Name | Description |
---|---|---|
System.IObservable<T> | obs | The source observable |
Returns
Type | Description |
---|---|
System.IObservable<System.ValueTuple<T, T>> | The resulting observable |
Type Parameters
Name | Description |
---|---|
T | The type of object in the observable |
ThrottleWhen<T>(IObservable<T>, IObservable<Boolean>)
Pass through values if and only if the last value produced by 'throttleCondition' is false. When 'throttleCondition' is false, no values are passed through. When 'throttleCondition' changes from true to false, if one or more values was blocked during the period in which the throttle was active, the latest value will be passed through.
Declaration
public static IObservable<T> ThrottleWhen<T>(this IObservable<T> self, IObservable<bool> throttleCondition)
Parameters
Type | Name | Description |
---|---|---|
System.IObservable<T> | self | The source observable |
System.IObservable<System.Boolean> | throttleCondition | An observable of booleans that determines the current throttle state |
Returns
Type | Description |
---|---|
System.IObservable<T> | The new observable |
Type Parameters
Name | Description |
---|---|
T | The datatype in the observable |