Using .NET 3.5, I'm finding that a CollectionView with a filter doesn't update when the underlying ObservableCollection(T) has items moved using ObservableCollection(T).Move. As a sanity check, I started with a simple project, one of Bea Stollnitz' from this page: http://bea.stollnitz.com/blog/?p=31. The actual project can be downloaded here: bea.stollnitz.com/files/28/FilterSample.zip. If you go into her Window1.xaml file and add a button like this:
<StackPanel>
<Button Content="Blah" Click="Button_Click"/>
and then add the click handler like this:
private void Button_Click(object sender, RoutedEventArgs e) {
GreekGods src1 = this.Resources["src1"] as GreekGods;
src1.Move(0, 1);
}
You'll find that pressing the button does not result in any change in the window. However, if you comment out the line of code in her constructor:
collectionView.Filter = new Predicate<object>(FilterOutA);
and then press the button, you'll see the two top elements swap position.
So what am I missing? Is this a bug, or does CollectionView just lose this functionality when you apply a filter? I can understand if you've got the CollectionView sorted, then changing the underlying order wouldn't change the CollectionView's order, but that's not true here. Shouldn't just having a Filter on the CollectionView continue to show the underlying ObservableCollection's order and update as it changes?
Thanks, Kevin