proxy.loginCompleted += new EventHandler<loginCompletedEventArgs>(loginfn);
proxy.loginAsync(username,password1);
void loginfn(object sender, loginCompletedEventArgs e)
{
if (e.Result.Count!=0)
{
System.Collections.ObjectModel.ObservableCollection<customer> temp = e.Result;
foreach (var item in temp)
{
Guid companyrefid = item.companyrefid;
int id = item.id;
}
NavigationService.Navigate(new Uri("/customernames.xaml", UriKind.Relative));
}
}
在wcf中:
public List<customer> login(string salesmanname, string usercode)//i am getting values in this
答案 0 :(得分:0)
您可以通过这种方式从ObservableCollection<T>
初始化List<T>
:
ObservableCollection<customer> temp = new ObservableCollection<customer>(e.Result);