/// <summary> /// /// </summary> /// <param name="stsz"></param> /// <returns></returns> private ListView BuildListView(Mp4StszBox stsz) { ListView listView = new ListView(); GridView grid = new GridView(); GridViewColumn c1 = new GridViewColumn(); c1.Header = "#"; c1.DisplayMemberBinding = new Binding("Key"); c1.Width = 50; grid.Columns.Add(c1); GridViewColumn c3 = new GridViewColumn(); //c1.DisplayMemberBinding = new Binding("?"); c3.Header = "Sample size"; c3.DisplayMemberBinding = new Binding("Value"); grid.Columns.Add(c3); // ObservableCollection<uint> coll = new ObservableCollection<uint>(stsz.Entries); var pairs = stsz.Entries.Select((val, index) => new KeyValuePair <int, uint>(index, val)).ToList(); ObservableCollection <KeyValuePair <int, uint> > coll = new ObservableCollection <KeyValuePair <int, uint> >(pairs); listView.ItemsSource = coll; listView.View = grid; return(listView); }
/// <summary> /// /// </summary> /// <param name="stsz"></param> /// <returns></returns> private ListView BuildListView(Mp4StszBox stsz) { ListView listView = new ListView(); GridView grid = new GridView(); GridViewColumn c1 = new GridViewColumn(); //c1.DisplayMemberBinding = new Binding("?"); c1.Header = "Sample size"; grid.Columns.Add(c1); ObservableCollection <uint> coll = new ObservableCollection <uint>(stsz.Entries); listView.ItemsSource = coll; listView.View = grid; return(listView); }