Observer.ToObserver<T> 方法

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

语法

声明
<ExtensionAttribute> _
Public Shared Function ToObserver(Of T) ( _
    handler As Action(Of Notification(Of T)) _
) As IObserver(Of T)
public static IObserver<T> ToObserver<T>(
    this Action<Notification<T>> handler
)
[ExtensionAttribute]
public:
generic<typename T>
static IObserver<T>^ ToObserver(
    Action<Notification<T>^>^ handler
)
static member ToObserver : 
        handler:Action<Notification<'T>> -> IObserver<'T> 

类型参数

  • T

参数

返回值

类型:System.IObserver<T>

使用说明

在 Visual Basic 和 C# 中,可以在 Action<Notification<T>> 类型的任何对象上将此方法作为实例方法来调用。当使用实例方法语法调用此方法时,请省略第一个参数。有关详细信息,请参阅扩展方法 (Visual Basic)扩展方法(C# 编程指南)

版本信息

适用于 Windows Phone 应用的 .NET

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

.NET Framework 安全性

请参阅

参考

Observer 类

Microsoft.Phone.Reactive 命名空间