Observable

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

Converts a .NET event to an observable sequence.

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

Syntax

'Declaration
Public Shared Function FromEvent ( _
    addHandler As Action(Of Action), _
    removeHandler As Action(Of Action) _
) As IObservable(Of Unit)
'Usage
Dim addHandler As Action(Of Action)
Dim removeHandler As Action(Of Action)
Dim returnValue As IObservable(Of Unit)

returnValue = Observable.FromEvent(addHandler, _
    removeHandler)
public static IObservable<Unit> FromEvent(
    Action<Action> addHandler,
    Action<Action> removeHandler
)
public:
static IObservable<Unit>^ FromEvent(
    Action<Action^>^ addHandler, 
    Action<Action^>^ removeHandler
)
static member FromEvent : 
        addHandler:Action<Action> * 
        removeHandler:Action<Action> -> IObservable<Unit> 
public static function FromEvent(
    addHandler : Action<Action>, 
    removeHandler : Action<Action>
) : IObservable<Unit>

Parameters

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

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

Return Value

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

See Also

Reference

Observable Class

FromEvent Overload

System.Reactive.Linq Namespace

Observable.FromEvent Method

Include Protected Members
Include Inherited Members

Converts a .NET event to an observable sequence.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

NameDescriptionPublic methodStatic memberFromEvent(Action<Action>, Action<Action>)Converts a .NET event to an observable sequence.Public methodStatic memberFromEvent(Action, Action)Converts a .NET event to an observable sequence.Public methodStatic memberFromEvent<TDelegate, TEventArgs>(Action, Action)Converts a .NET event to an observable sequence.Public methodStatic memberFromEvent<TDelegate, TEventArgs>(Func<Action, TDelegate>, Action, Action)Converts a .NET event to an observable sequence.Top

See Also

Reference

Observable Class

System.Reactive.Linq Namespace