Thank you for the sample Rachel, it's not very different from my approach.
However I'm trying to avoid code-behind, so my example has a button bound to an ICommand, which then executes the ApplyFilter( ) function in the viewmodel.
In your example, similar to what you have a button_click even handler to null out the ItemSource before applying the filter. I could have also implement it this
way but I'd like to use the commanding approach.
What I was hoping to achieve is that the filter would be set (on the CollectionView ) in the viewmodel, and this would then notify the Kanban control to update itself.
Perhaps I'm using Property notifications incorrectly and should be using COllection notifications, but the collection isn't really changing, only the collectionview.
See attached example.
thanks
Thanks Rachel. Your solution works. However I found that if the filter was cleared, then your code would no longer update the Kanban control,
because the ItemSource was nulled out. The solution I found is something like shown below, a slight variation to yours
public void ExecFilter( object param ){
SfKanban myKanbanObj = param as SfKanban;
myKanbanObj.ItemSource = null;
_inventoryView.Filter += YearFilter;
OnPropertyChanged("Filter");
myKanbanObj.ItemSource = _inventoryView; // now the filter can be reapplied after clearing
}
public void ClearFilter( )
{
_inventoryView.Filter = null;
OnPropertyChange("Filter");
}