我按顺序做事情
按钮单击
显示进度对话框
调用soap webservice获取使用async方法的数据,如下所示
var data = await Task.Factory.FromAsync((asyncCallback,asyncState)=> _objClient.BeginGetData(userId,nameSearch,asyncCallback,asyncState),(asyncResult)=> _objClient.EndGetData(asyncResult),null);
关闭进度对话框
了解我如何打开对话框:
ProgressDialog dialog;
public void ShowProgressDialog(string message, string title)
{
dialog = new ProgressDialog(Xamarin.Forms.Forms.Context);
dialog.SetTitle(title);
dialog.SetMessage(message);
dialog.SetCancelable(false);
dialog.Indeterminate = true;
dialog.SetIcon(Resource.Drawable.icon);
dialog.SetProgressStyle(ProgressDialogStyle.Spinner);
dialog.Show();
}
我也尝试打开如下对话框
public void ShowProgressDialog(string message, string title)
{
dialog = ProgressDialog.Show(Xamarin.Forms.Forms.Context, title, message, true, false);
dialog.SetIcon(Resource.Drawable.icon);
dialog.SetProgressStyle(ProgressDialogStyle.Spinner);
}
我尝试了不同的线程,但没有成功。你能帮我再次重新打开它或者我需要它吗?
先谢谢。