MVVM Silverlight CollectionViewSource Filtering

MVVM Silverlight CollectionViewSource Filtering

Old forum URL: forums.lhotka.net/forums/t/10617.aspx


JonM posted on Tuesday, August 16, 2011

I'm using CSLA 4 + Silverlight + MVVm.  Right now I'm binding my viewmodel to the UI as a CollectionViewSource.   The collection viewsource has a property called Filter that takes a method name.  This method gets called everytime the filter changes.  I can get it to work but I have to put that method in my UI usercontrol class.  I want to put that logic into view model class.  Has anyone solved this?  Is there another method for filtering?  Do I need to write a collection view source that helps deal with this?  I'm just wondering how other people are dealing with this.

sholder replied on Friday, September 09, 2011

Don't use the CollectionViewSource directly.  The CollectionViewSource has a property .View which implements the interfaces you want when binding.  The .View property also implements ICollectionView which has a property Filter of type Predicate<object> which you can use to filter the View.

 

Shane Holder

wendellcypert replied on Saturday, September 10, 2011

can't completely download ford racing 2 to my windows vista, the wma:347 no source filter found shows up.

 

Lipotrim

Copyright (c) Marimer LLC