Observable.FromEventPattern Method (Action(Of EventHandler), Action(Of 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 Shared Function FromEventPattern ( _
	addHandler As Action(Of EventHandler), _
	removeHandler As Action(Of EventHandler) _
) As IObservable(Of EventPattern(Of EventArgs))
Dim addHandler As Action(Of EventHandler)
Dim removeHandler As Action(Of EventHandler)
Dim returnValue As IObservable(Of EventPattern(Of EventArgs))

returnValue = Observable.FromEventPattern(addHandler, _


Type: System.Action(Of EventHandler)
The action that attaches the given event handler to the underlying .NET event.
Type: System.Action(Of EventHandler)
The action that detaches the given event handler from the underlying .NET event.

Return Value

Type: System.IObservable(Of EventPattern(Of EventArgs))
The observable sequence that contains data representations of invocations of the underlying .NET event.