Method SubscribeTo
SubscribeTo<TSource>(Control, ObservableCollection<TSource>, Action<TSource[]>)
Subscribes the control to change notifications in the specified observable collection.
public static IDisposable SubscribeTo<TSource>(this Control control, ObservableCollection<TSource> source, Action<TSource[]> action)
Parameters
controlControlThe control on which to observe notifications.
sourceObservableCollection<TSource>A data collection that provides notifications when items are added, removed, or when the whole list is refreshed.
actionAction<TSource[]>The action to invoke on each new version of the observable collection.
Returns
- IDisposable
A disposable object used to unsubscribe from the observable sequence.
Type Parameters
TSourceThe type of the elements in the
sourcecollection.
SubscribeTo<TSource>(Control, IObservable<TSource>, Action<TSource>)
Subscribes the control to event notifications from the specified observable sequence.
public static IDisposable SubscribeTo<TSource>(this Control control, IObservable<TSource> source, Action<TSource> action)
Parameters
controlControlThe control on which to observe notifications.
sourceIObservable<TSource>The observable sequence of event notifications.
actionAction<TSource>The action to invoke on each event notification.
Returns
- IDisposable
A disposable object used to unsubscribe from the observable sequence.
Type Parameters
TSourceThe type of the elements in the
sourcesequence.