I have a TagTypeController class that provides a collection view to a controller for a WPF UserControl, which holds a private reference to the collection view.
_ttController = new TagTypeController(_isProd);
CollectionView tagTypeList = _ttController.getTagTypes();
In the TagTypeController, when creating the CollectionView, I'm setting the filter delegate
if (_tagTypeList == null)
_tagTypeList = new CollectionView(CollectionViewSource.GetDefaultView(_tagTypeTable));
_tagTypeList.Filter = new Predicate<object>(filterTagTypes);
I would like to locate all the logic for filtering, etc. of that collectionview in the TagTypeController class. The problem is, when the text changes in the TextBox of the UserControl, I'm responding to that event by delegating to the controller for the UserControl. When I ask the tagTypeList to refresh, it does not call the filterTagTypes method. Is it not possible to have the filter delegate in a different class?
Thanks.
EDIT: adding requested code
//parse the string to get just the portion after the last comma and space
Int32 _lastComma = _tempText.LastIndexOf(",");
_ttController.searchText = _tempText.Substring(_lastComma + 1).Trim();
tagTypeList.Refresh();