Observable.FromEvent<TDelegate, TEventArgs> Method (Func<EventHandler<TEventArgs>, TDelegate>, Action<TDelegate>, Action<TDelegate>)

March 22, 2012

Returns an observable sequence that contains the values of the underlying .NET Framework event.

Namespace:  Microsoft.Phone.Reactive
Assembly:  Microsoft.Phone.Reactive (in Microsoft.Phone.Reactive.dll)

public static IObservable<IEvent<TEventArgs>> FromEvent<TDelegate, TEventArgs>(
	Func<EventHandler<TEventArgs>, TDelegate> conversion,
	Action<TDelegate> addHandler,
	Action<TDelegate> removeHandler
)
where TEventArgs : EventArgs

Type Parameters

TDelegate
TEventArgs

Parameters

conversion
Type: System.Func<EventHandler<TEventArgs>, TDelegate>
addHandler
Type: System.Action<TDelegate>
removeHandler
Type: System.Action<TDelegate>

Return Value

Type: System.IObservable<IEvent<TEventArgs>>
Returns IObservable<T>.

Windows Phone OS

Supported in: 7.1, 7.0

Windows Phone

Show: