The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

Observable.FromEvent<TEventArgs>(Action<Action<TEventArgs>>, Action<Action<TEventArgs>>)

Observable.FromEvent<TEventArgs> Method (Action<Action<TEventArgs>>, Action<Action<TEventArgs>>)

Converts a .NET event to an observable sequence.

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


Public Shared Function FromEvent(Of TEventArgs) ( _
    addHandler As Action(Of Action(Of TEventArgs)), _
    removeHandler As Action(Of Action(Of TEventArgs)) _
) As IObservable(Of TEventArgs)
Dim addHandler As Action(Of Action(Of TEventArgs))
Dim removeHandler As Action(Of Action(Of TEventArgs))
Dim returnValue As IObservable(Of TEventArgs)

returnValue = Observable.FromEvent(addHandler, _
public static IObservable<TEventArgs> FromEvent<TEventArgs>(
    Action<Action<TEventArgs>> addHandler,
    Action<Action<TEventArgs>> removeHandler
generic<typename TEventArgs>
static IObservable<TEventArgs>^ FromEvent(
    Action<Action<TEventArgs>^>^ addHandler, 
    Action<Action<TEventArgs>^>^ removeHandler
static member FromEvent : 
        addHandler:Action<Action<'TEventArgs>> * 
        removeHandler:Action<Action<'TEventArgs>> -> IObservable<'TEventArgs> 
JScript does not support generic types and methods.

Type Parameters

  • TEventArgs
    The type of event.


  • addHandler
    Type: System.Action<Action<TEventArgs>>
    Action that attaches the given event handler to the underlying .NET event.

  • removeHandler
    Type: System.Action<Action<TEventArgs>>
    Action that detaches the given event handler from the underlying .NET event.

Return Value

Type: System.IObservable<TEventArgs>
Observable sequence that contains data representations of invocations of the underlying .NET event.

See Also


Observable Class

FromEvent Overload

System.Reactive.Linq Namespace