【发布时间】:2011-03-02 05:44:20
【问题描述】:
public class AllViewModel
{
private List<Settings> SettingsList;
public ViewAgendaAllViewModel()
{
client.SupplierListWithSettings(GetSupplierListWithSettings_Completed)
}
public void GetSupplierListWithSettings_Completed(object sender, Supplier_GetListWithSettingsCompletedEventArgs e)
{
if (e.Error == null)
{
if (e.Result != null)
{
SettingsList = new List<Settings>();
foreach (VCareSupplierDto obj in e.Result)
{
SettingsList.Add(obj);
}
}
}
}
}
问题:由于异步调用,未设置设置列表属性。
这是我的课程,我想同步调用 ServiceMethod SupplierListWithSettings。
当我创建 AllViewModel 的实例时,它应该加载设置。
预期:当我创建 AllViewModel 的实例时,它应该包含 SettingList 属性。
【问题讨论】:
标签: c# wcf asynchronous