views:

113

answers:

2

I need to cast an IList to a Collection (System.Collections.ObjectModel)

How do you go about this?

+4  A: 

Just use the constructor:

IList<T> myList = ...
System.Collections.ObjectModel.Collection<T> omc = 
           new System.Collections.ObjectModel.Collection<T>(myList);
bruno conde
+4  A: 
Collection<MyClass> coll = new Collection<MyClass>(myIList);
Guido Domenici