我对Reactive Extensions非常感兴趣,但是我找不到最新的教程。我从Curing the asynchronous blues with the Reactive Extensions for .NET开始,但是已经过时了。我可以找出一些更改,但无法获得许多示例。
我在网上发现了许多文章,主要来自2009年,2010年,但它们与当前版本也不兼容。我对将Rx与Windows Phone和WebClient一起使用特别感兴趣:
WebClient wc = new WebClient();
var o = Observable.FromEvent<DownloadStringCompletedEventArgs>(wc, "DownloadStringCompleted").Select(newString => newString.EventArgs.Result);
// Subscribe to the observable, and set the label text
o.Subscribe(s => myLabel.Text = s);
// Start the download
wc.DownloadStringAsync(new Uri("http://www.data.com/service"));
不再工作,用FromEvent
替换FromEventPattern
是不够的。
有人可以指出我最新的资源吗?
[学习Rx时,第一件事就是了解IObservable背后的原理,以及基于推论的本质与IEnumerable的比较。我建议使用以下示例进行详细说明:A[nother] Simpler Tutorial for Reactive Extensions
李·坎贝尔(Lee Campbell)提供了一系列不错的系列,解释了api及其使用时间。 他还试图使其与最新版本保持同步:Reactive Extensions for .NET an Introduction
该系列现在可以在Introduction to Rx处以书的形式获得>
顺便说一下,我也写了一篇关于用rx解决现实生活中的问题的博客文章:Using Reactive Extensions for Streaming Data from Database
希望这会有所帮助。
我找到了一个名为Reactive Extensions (Rx) Koans的“边做边学”项目。它的最新更新时间是2012年3月,所以它是最新的。
到目前为止,帮助我围绕Rx扎根的最佳资源是:http://www.introtorx.com/
逐行(逐行)阅读本在线书并进行练习。很好,当我开始使用Rx时就做到了。