I have my colleciton of header/children data in an observablecollection that is bound to the outlook bar. How do I sort the listbox that is in each outlookbar area ?
Hello,
A solution to this problem is to presort the data before binding it to the XamOutlookBar. Another way is to add a button in the XamOutlookBar and handle its click event. A quick way to sort the observable collection is like this:
private void buttonSort_Click(object sender, RoutedEventArgs e) {
List<int> temp = observableCollection.ToList(); observableCollection.Clear(); temp.Sort(); foreach (int item in temp) { observableCollection.Add(item); } listView.ItemsSource = observableCollection;
}
Hope this helps