I'm implementing a textbox filter on a list based on Josh Smith's example at http://joshsmithonwpf.wordpress.com/2007/06/12/searching-for-items-in-a-listbox. Basically, it sets the Filter on the view to a delegate that checks against the text in the search box. I hook up the filter like so:
var pickerView = FindResource("sortedRulesView") as CollectionViewSource;
new TextSearchFilter(pickerView.View, SearchTextBox);
Later, when I refresh the ObjectDataProvider, the filter is lost. I've noticed that pickerView.View has a different hashcode after the refresh. Are all the views recreated when the data refreshes? Does that mean I should reattach the filter again whenever I call ObjectDataProvider.Refresh()? Is there some smarter way to install this filter that wouldn't require babysitting?