Table of Contents

Method SubscribeTo

Namespace
Bonsai.Gui
Assembly
Bonsai.Gui.dll

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

control Control

The control on which to observe notifications.

source ObservableCollection<TSource>

A data collection that provides notifications when items are added, removed, or when the whole list is refreshed.

action Action<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

TSource

The type of the elements in the source collection.

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

control Control

The control on which to observe notifications.

source IObservable<TSource>

The observable sequence of event notifications.

action Action<TSource>

The action to invoke on each event notification.

Returns

IDisposable

A disposable object used to unsubscribe from the observable sequence.

Type Parameters

TSource

The type of the elements in the source sequence.