Observable.FromEvent<TEventArgs> 方法 (Action<EventHandler<TEventArgs>>, Action<EventHandler<TEventArgs>>)

命名空间:  Microsoft.Phone.Reactive
程序集:  Microsoft.Phone.Reactive(在 Microsoft.Phone.Reactive.dll 中)

语法

声明
Public Shared Function FromEvent(Of TEventArgs As EventArgs) ( _
    addHandler As Action(Of EventHandler(Of TEventArgs)), _
    removeHandler As Action(Of EventHandler(Of TEventArgs)) _
) As IObservable(Of IEvent(Of TEventArgs))
public static IObservable<IEvent<TEventArgs>> FromEvent<TEventArgs>(
    Action<EventHandler<TEventArgs>> addHandler,
    Action<EventHandler<TEventArgs>> removeHandler
)
where TEventArgs : EventArgs
public:
generic<typename TEventArgs>
where TEventArgs : EventArgs
static IObservable<IEvent<TEventArgs>^>^ FromEvent(
    Action<EventHandler<TEventArgs>^>^ addHandler, 
    Action<EventHandler<TEventArgs>^>^ removeHandler
)
static member FromEvent : 
        addHandler:Action<EventHandler<'TEventArgs>> * 
        removeHandler:Action<EventHandler<'TEventArgs>> -> IObservable<IEvent<'TEventArgs>>  when 'TEventArgs : EventArgs

类型参数

  • TEventArgs

参数

返回值

类型:System.IObservable<IEvent<TEventArgs>>

版本信息

适用于 Windows Phone 应用的 .NET

受以下版本支持:Windows Phone 8、Silverlight 8.1

.NET Framework 安全性

请参阅

参考

Observable 类

FromEvent 重载

Microsoft.Phone.Reactive 命名空间