FromEventPattern Method (Action(EventHandler), Action(EventHandler))

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

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

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

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


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

Return Value

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