我对反应式扩展非常感兴趣,但我找不到最新的教程。我开始于使用 .NET 响应式扩展消除异步忧郁症 http://go.microsoft.com/fwlink/?LinkId=208528但它已经过时了。我可以找出一些改变,但我无法让很多例子发挥作用。
我在网上找到了很多文章,主要来自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
with FromEventPattern
是不足够的。
有人可以向我指出最新的资源吗?
学习 Rx 时,第一件事是了解 IObservable 背后的哲学,以及它基于推送的性质与 IEnumerable 相比如何。我建议使用以下一个来获得更好的解释:[另一个] 反应式扩展的更简单教程 http://web.archive.org/web/20140204230626/http://notabeta.com/2011/01/07/another-simpler-tutorial-rx/
Lee Campbell has nice series explaining the api and when to use them. He also tries to keep it up to date with latest releases: Reactive Extensions for .NET an Introduction
http://leecampbell.blogspot.com/2010/08/reactive-extensions-for-net.html The series is now available as a book at Introduction to Rx http://www.introtorx.com/
顺便说一句,我还写了一篇关于使用 rx 解决现实生活问题的博客文章:使用反应式扩展从数据库传输数据 http://www.giorgi.dev/reactive-extensions/using-reactive-extensions-for-streaming-data-from-database/
希望这可以帮助。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)