Cast IEnumerable<T> to ObservableCollection<T> without constructor injection the IEnumerable<T> -


How can I do this?

It is not:

OverviewCall Obscol = new ObservableCollection (myIEnumerable);

Scenario:

  var Select new customers from query = clients () {product = products from p to p.Id = C.Id P};  

The product is an observable collection, so it can not take IEnumerable results from the selection above ...

How to insert

like this:

  viewcollection obscol = new ObservableCollection (myIEnumerable.ToList ());  

Note that observationconcollection example client will not show changes in the list.

Edit : The selection extension method gives an example of a compiler-generated iterator class. Since this class is not deprived of observational collection , it is impossible to put it in one.


Comments