I have a List<T>
which is being populated from JSON. I need to convert it into an ObservableCollection<T>
to bind it to my GridView
.
Any suggestions?
ObservableCollection < T > has a constructor overload which takes IEnumerable < T >
Example for a List of int
:
ObservableCollection<int> myCollection = new ObservableCollection<int>(myList);
One more example for a List of ObjectA
:
ObservableCollection<ObjectA> myCollection = new ObservableCollection<ObjectA>(myList as List<ObjectA>);