4

Where can I find this class? I have included the Rx extensions. I have made sure the version I'm compiling to is Silverlight 4. My VS2010 IDE still has no idea what the type IObservable is.

I get a compile error saying "type or namespace IObservable could not be found"

I didn't see them in the System.Collections.Generic namespace like this thread suggests http://dotnet.uservoice.com/forums/4325-silverlight-feature-suggestions/suggestions/523437-include-iobserver-t-and-iobservable-t-interface

Am I missing a reference to a dll?

4

2 回答 2

8

它在 System 命名空间中,类型为 IObservable<T>。您需要从 ReactiveExtensions SDK 添加对 System.Observable.dll 的引用。

此外,虽然不是严格要求,但您可能希望添加对 System.Reactive.dll 的引用,其中包含许多对 IObservable<T> 进行操作的扩展方法。

于 2010-09-29T18:25:57.080 回答
1

答案不是很长,但也没什么好说的。

Silverlight 仅使用.NET Framework 的一小部分。也就是说,如果您不包含(参考) System.Reactive.dll ,则 Silverlight 4 中不包含 IObservable

于 2010-09-29T17:59:06.370 回答