UI加载之前从Web服务获取数据 [英] Get Data From Web service Before UI Load

查看:79
本文介绍了UI加载之前从Web服务获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个Web服务,它从数据库中获取一些数据并将其显示给用户.
我在构造函数中调用我的服务
但是当我的UI完全加载并且用户不得不等到Web服务检索数据然后调用了webservice_completed方法并立即向用户显示数据时,我才得到结果

我该如何解决我的问题?当用户打开表单(或User-control)时,它包含数据???
谢谢您

Hi
I have a web service that it gets some data from data base and show them to user.
im calling my service in my constructor
But i get the result when my UI completely loaded and user has to wait till the web service retrieve the data and then the webservice_completed method has been called and there im going to show the data to user

How can i solve my problem and when user Opened the form ( or User-control ) it contains data ???
thank you

推荐答案

您是否尝试过将代码以将数据检索到.cs文件中的InitializeComponent()之前?
Have you tried placing the code to retrieve the data before InitializeComponent() in the .cs file?


这篇关于UI加载之前从Web服务获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆