同步网络服务和模式对话框!
问题是...
应用程序可能在 Silverlight 中。
可以实现SYNChonous WebService调用吗?
我尝试通过网格、编辑和在 SL 中使用 Web 服务来实现任何应用程序 RIA,但我不明白如何在没有 SYNC 调用的情况下使其成为可能。
我还需要使用模态对话框来完成某些任务。
我研究了 Daniel Vaughan 的工作,他设法在 ThreadPool 内同步运行 Web 服务调用,但是我如何才能执行该 GUI,等待对 Web 服务的调用?
Daniel Vaughan 网站:http://danielvaughan。 orpius.com/post/Synchronous-Web-Service-Calls-with-Silverlight-2.aspx
结合其他语言的这些基本内容,恕我直言,可以构建真正的应用程序。
听取建议...
Cheva。
the question is....
The application maybe in Silverligth.
It's possible to implement SYNChonous WebService call?
I try to realize any application RIA, with Grids, Edits and using WebServices in SL, but I do not understand how to make it's possible without a SYNC calls.
And I also need to use MODAL DIALOGS for some tasks.
I investigated the work of Daniel Vaughan who manages to run Web service calls synchronously, within a ThreadPool, but How I can do that GUI, wait for calls to webservices?
Daniel Vaughan Web: http://danielvaughan.orpius.com/post/Synchronous-Web-Service-Calls-with-Silverlight-2.aspx
Combining these basic things for other languages, IMHO is possible to build true application.
Hear suggestions...
Cheva.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最好分析实际目标,因为您想在 GUI 中执行此操作,所以在获取或处理适当的资源之前阻止用户活动。
实现该目标的一种方法是进行同步调用,但这只会以用户不友好的方式锁定 UI。我们真正想要的是以一种提供信息的方式锁定 UI。事实上,我们希望 UI 线程能够自由地以丰富的 UI 方式(正在进行一些动画或进度)显示“请稍等,我正忙于处理您的请求”。
为此,您可以使用
BusyIndicator
控件(在其中放置当前 UI 的全部或部分内容)。您将在 Silverligt 工具包中找到BusyIndicator
。如果您使用的是 VS2010 和 Silverlight 4,类似的控件现在是 Ria Services SDK 的一部分,并且可以称为Activity
。现在,当您想要执行“同步”操作时,您可以将 BusyIndicator.IsBusy 属性设置为 true(在 SL4 中,将 Activity.IsActive 设置为 true)。然后发出异步请求,请求完成后将该属性设置为 false。
Its best to analyse the actual objective which, since you want to do this in the GUI, is to prevent user activity until approriate resources have been fetched or processed.
One way to acheive that goal would be to have a synchronous call but the would just lock the UI up in a user unfriendly way. What we realy want is to lock the UI up but in an informative way. In fact we want the UI thread free to display such "Please wait I'm busy processing your request" preferable in a rich UI manner (some animation or progress going on).
To that you can use the
BusyIndicator
control (inside which you place all or just part of your current UI). You'll find theBusyIndicator
in the Silverligt Toolkit. If you are using VS2010 and Silverlight 4 a Similar control is now part of the Ria Services SDK and can is calledActivity
.Now when you want to do something "synchronous" you set the
BusyIndicator.IsBusy
property to true (in SL4 you set theActivity.IsActive
to true). Then make a asynchronous request, on completion of the request you set the property to false.无论好坏,Silverlight 不支持对 Web 服务的同步调用。最好的选择是采用类似于 Anthony 提议的方法,以便在 UI 中获得所需的最终结果,而无需实际锁定 UI 线程。
For better or for worse, Silverlight doesn't support synchronous calls to web services. Your best bet is to go with something similar to what Anthony proposed in order to get the desired end result in your UI without actually locking up the UI thread.