list to observablecollection c# code example
Example 1: how to cast list to observablecollection c#
var stringList = new List<string>() {"1","2","3"};
var obStrings = new ObservableCollection<string>(stringList);
Example 2: how to add a list to observablecollection in c#
var stringList = new List<string>() {"1","2","3"};
var obStrings = new ObservableCollection<string>(stringList);
var ob2list = obStrings.ToList();
ob2list.AddRange(stringList);
obStrings = new System.Collections.ObjectModel.ObservableCollection<string>(ob2list);