Reputation: 1398
Is there some way to get ObservableCollection<Object>
as result of RIA Services method under WPF Client to RIA Services?
Upvotes: 0
Views: 224
Reputation: 2108
Simple, You can map your Ria Service Result as IEnumerable and after, init new ObservableCollection(riaOperationContractResult) when service response. This is an example:
MyService myService = new MyService();
myService.OnOperationContractExecuted += new EventHandler(OnOperationContractExecuted);
myService.BeginOperationContract(...);
...
private void OnOperationContractExecuted(object sender, OperationContractEventArgs e) {
IEnumerable<MyServiceObj> objs = (IEnumerable<MyServiceObj>e.Result);
ObservableCollection<MyServiceObj> obsObjs = new ObservableCollection<MyServiceObj>(objs);
}
...
Upvotes: 1