我首先要问一下,我设立了网站服务处。 而且,我有视窗电话用户申请和窗口8的客户申请,现在我把头7号申请连接起来,我利用这些方法从窗户电话服务获得一些东西:
TimeTierBusiness.BusinessesClient client = new TimeTierBusiness.BusinessesClient();
client.GetAllCompleted += new EventHandler<TimeTierBusiness.GetAllCompletedEventArgs>(client_GetAllCompleted);
client.GetAllAsync();
为了取得结果,我只去了客户。 各位可以认为:
void client_GetAllCompleted(object sender, TimeTierBusiness.GetAllCompletedEventArgs e)
{
listNearbyBusinesses.ItemsSource = e.Result;
myPopup.IsOpen = false;
}
现在,在8米罗的窗口上,我没有可以补充的结晶活动,当我把客户放在8个窗口上时,这完全是等待的“Get AllAsync”方法。
任何帮助都会受到高度赞赏,因为我现在可以把这一服务用在我的 met子上。
感谢:
因此,解决办法是,采用“合成方法”,见以下法典:
//My WCF Service Client
TimeTierBusiness.BusinessesClient bClient = new TimeTierBusiness.BusinessesClient();
//The list I am going to get from the service
public List<TimeTierBusiness.BusinessRatingViewModel> listBusinessViewModel;
填补本职务的空缺的方法
private async void GetAllAsyc()
{
System.Collections.ObjectModel.ObservableCollection<TimeTierBusiness.BusinessRatingViewModel> x = await bClient.GetAllAsync();
listBusinessViewModel = x.ToList();
ItemListView.ItemsSource = listBusinessViewModel;
}