I have made a custom Searchable ComboBox, with a Filter defined on the default CollectionView
CollectionViewSource.GetDefaultView(this.ItemsSource)
view.Filter += FilterPredicate;
The filter predicate of the ComboBox :
private bool FilterPredicate(object value)
{
return PropertyPathHelper.GetValue(value, FilterPropertyPath).ToString().Contains(PART_FilterTextBox.Text);
}
//value is instance of current filtered item: Student{ FullName="SunnyXyz" , Age=30 }
//& FilterPropertyPath="FullName"
FilterPropertyPath is a "string" DependancyProperty, that acts similar to DisplayMemberPath, to locate the text property on which to apply the filtering in the bound item. PropertyPathHelper.GetValue creates a dummy binding & resolves the bind path, but this method is slow/inelegant/doesn't seem like the right approach. (from https://stackoverflow.com/a/7041604/852318)
Can anyone help with an alternative right way or a more elegant way to pass the FilterPropertyPath information