I have 2 ListBox which are bounded to the same source Photos (which is a collection of Photo)
I know that there is a way to get the CollectionView of the source (which is Photos) and then any change on this CollectionView (such as sorting for example) will affect on all Targets bounded to that source.
what I can’t understand is why when i am changing the SortDescriptions of one ListBox, i see the change on the other also.
myListBox1.Items.SortDescriptions.Add(new SortDescription(“ProperyName”,ListDirection.Ascending));
makes both myListBox1 and myListBox2 to be changed..
any ideas?
thanks!
From MSDN:
You could create a CollectionViewSource in XAML as two resources, and bind your ListBoxes to these views, instead of the collections directly.