Is there a useful design pattern for chained asynchronous/event calls?

断了今生、忘了曾经 提交于 2019-12-06 10:57:40

Well, I'd recommend first that you take advantage of the asynchronous nature of Silverlight by running all three calls simultaneously, if possible.

You could do this "sequentially" with tasks (task continuations, in particular), but you may also want to look at the Rx library, which is designed to gracefully handle this kind of situation.

Another final tip: disallowing user interaction isn't recommended. At least give them the option of cancelling the operation.

I think this is what the new Tasks (in the Parallel library) classes try to abstract, but I could be wrong :)

I might be wrong here but aren't delegates already syncrhonous. You can make them asynchronous by using the BeginInvoke method. Here is a good resource for syncronous and asynchronous method calls and explains some patterns etc. http://support.microsoft.com/kb/315582

The title of the article may be How to call a Visual C# method asynchronously but there are example of synchronous method calls about half way through.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!