Asynchronous Callbacks with Rx - by Jesse Liberty (@JesseLiberty)
One of the tried and true patterns in .NET programming is to call an Asynchronous service (e.g., BeginGetResponse) and to then provide a callback to a second method for when the call completes. This can get very complex very quickly if you have chained calls (call this, then when you finish, call that)
Let’s take a look at how you can simplify such a call with Rx by examining making a HTTPWebRequest.
We’ll begin by creating a dead-simple UI, consisting of a TextBox (to type in a URL), a TextBlock (to display the returned HTML) and a button (to kick things off). For simplicity, we* created this as a WPF application, though you could certainly do the same in Silverlight or Windows Phone.
Read More from: Original Source
Post Contributed by: Kunal Chowdhury
Kunal is the Site Admin and Contributor of Silverlight-Zone. He is a Software Engineer, Microsoft Silverlight MVP, Code Project Mentor and a Code Project MVP. He is also an active Author in SilverlightShow.net and a speaker in various community events. He works on Microsoft Platform and very passionate about Silverlight technology. He started his career in 2007 and achieved various awards during his professional life.
He shares his findings in his personal blog: http://www.kunal-chowdhury.com and he also tweets at: @kunal2383.