您好,我使用多次不同参数值调用Async方法,在完成的事件中给出相同的结果。在Silverlight中多次调用异步方法问题
client.ListAllLookupValuesByTypeCompleted += client_ListAllAddressFormatCompleted;
client.ListAllLookupValuesByTypeAsync("AddressFormat");
client.ListAllLookupValuesByTypeCompleted += client_ListAllPhoneFormatCompleted;
client.ListAllLookupValuesByTypeAsync("PhoneFormat");
void client_ListAllAddressFormatCompleted(object sender, ListAllLookupValuesByTypeCompletedEventArgs e)
{
cmbAddressFormat.ItemsSource = e.Result;
}
void client_ListAllPhoneFormatCompleted(object sender, ListAllLookupValuesByTypeCompletedEventArgs e)
{
cmbPhonePrintFormat.ItemsSource = e.Result;
}
请帮帮我。 谢谢。
当我遇到同样的问题时,我扩展了服务客户端类(它是一个部分类)并添加了我自己的方法,它们使用内部的BeginSomeOperation和EndSomeOperation方法。每次都不可能创建新的服务实例,因为我需要使用会话。 – vorrtex 2011-03-16 08:38:46
当有人回答您的问题时,请点击该答案旁边的绿色勾号。谢谢。 – jumbo 2011-03-18 23:11:41