我制作列表的代码是这样的:
[OperationContract]
List<it_position> GetAllPositions(){
PositionDataClassesDataContext context = new PositionDataClassesDataContext();
var result = from positions in context.it_positions select positions;
return result.ToList();
}
我从一个方法中获取数据
PositionServiceReference.PositionServiceClient service = new
PositionServiceReference.PositionServiceClient();
service.GetAllPositionsCompleted += new
EventHandler<PositionServiceReference.GetAllPositionsCompletedEventArgs>
(service_GetAllPositionsCompleted);
service.GetAllPositionsAsync();
但是我怎样才能让结果成为我可以使用的数组呢?它们现在只是数据列表中的 ItemSoruces ......
void service_GetAllPositionsCompleted(object sender,
PositionServiceReference.GetAllPositionsCompletedEventArgs e)
{
dgEmployee.ItemsSource = e.Result;
}