How I can implement sync calls to WCF services in SIlverlight?

前端 未结 4 1446
北荒
北荒 2020-12-11 12:07

Sometimes I need to call WCF service in Silverlight and block UI until it returns. Sure I can do it in three steps:

  1. Setup handlers and block UI
  2. Call s
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-11 12:39

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

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

    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

提交回复
热议问题