我对响应式扩展(Reactive Extensions)非常感兴趣,但是我找不到最新的教程。我开始尝试学习 使用.NET的响应式扩展来解决异步问题,但它已经过时了。我可以弄清楚一些更改,但我不能让许多示例工作。
我在网上找到了很多文章,主要是2009年、2010年的,但它们也与当前版本不兼容。我特别想了解如何在Windows Phone和WebClient中使用Rx:
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
是不够的。
有人能给我指一个最新的资源吗?