Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Observable.FromEventPattern<TEventArgs> Method (Action<EventHandler<TEventArgs>>, Action<EventHandler<TEventArgs>>)

Converts a .NET event, conforming to the standard .NET event pattern, to an observable sequence with the specified add handler and remove handler.

Namespace:  System.Reactive.Linq
Assembly:  System.Reactive (in System.Reactive.dll)

public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>(
	Action<EventHandler<TEventArgs>> addHandler,
	Action<EventHandler<TEventArgs>> removeHandler
where TEventArgs : EventArgs

Type Parameters


The type of event.


Type: System.Action<EventHandler<TEventArgs>>
The action that attaches the given event handler to the underlying .NET event.
Type: System.Action<EventHandler<TEventArgs>>
The action that detaches the given event handler from the underlying .NET event.

Return Value

Type: System.IObservable<EventPattern<TEventArgs>>
The observable sequence that contains data representations of invocations of the underlying .NET event.
© 2015 Microsoft