show array in listbox c# code example

Example 1: how to add a list to observablecollection in c#

var stringList = new List<string>() {"1","2","3"};
//Use the contructor override to add the list to the new collection
var obStrings = new ObservableCollection<string>(stringList);

//If you already have a collection. Store that into a tempory list, 
//add the new range to the tempory list. Then same as above
var ob2list = obStrings.ToList();
ob2list.AddRange(stringList);
obStrings = new System.Collections.ObjectModel.ObservableCollection<string>(ob2list);

Example 2: how to add object to list in javascript

var a=[]
var b={};
a.push(b);