且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何能实现在Silverlight中的同步调用WCF服务?

更新时间:2023-09-24 15:12:40

这里的点;您不该做同步IO在Silverlight。停止战斗吧!相反:

Here's the point; you shouldn't do sync IO in Silverlight. Stop fighting it! Instead:


  • 禁用UI

  • 的任何关键部件开始异步IO与回调

  • (...)

  • 在回调,处理数据并更新/重新启用UI

  • disable any critical parts of the UI
  • start async IO with callback
  • (...)
  • in the callback, process the data and update/re-enable the UI

碰巧的是,我积极努力就如何使异步模式更加平易近人(特别是与Silverlight记)。 这里第一个尝试,但我有更好的东西我的袖子;-p

As it happens, I'm actively working on ways to make the async pattern more approachable (in particular with Silverlight in mind). Here's a first stab, but I have something better up my sleeve ;-p