In a world other than Silverlight, it's easy to use LINQ to create an ObservableCollection. This is because the ObservableCollection class has constructors that accept any IEnumerable <T> or List <T>. However, the Silverlight version does not work! This means that the code, for example:
var list = (from item in e.Result
select new ViewModel(item)).ToList();
Items = new System.Collections.ObjectModel.ObservableCollection<ViewModel>(list);
will not work in Silverlight.
Is there another way to make this work, besides resorting to a for-each statement?
source
share