I would like to attempt to separate my filter functions from my view  
so that I am not duplicating code when two views share similar filter  
functions.  My idea was to create a class that contains a  
ListCollection and all the appropriate FilterFunctions for that  
collection.  The FilterFunctions would then be applied by methods in  
that class.

The problem I am having is that I can't pass any parameters to the  
FilterFunction when I assign it to the specific ListCollection.  The  
FilterFunction seems like it needs to be tightly coupled with the  
view in order to work.

To work around this, for application wide filters, I am saving a  
filter value on my model and then referencing the model from my  
FilterFunction (which still isn't ideal).  However in some cases this  
isn't appropriate since the filter value doesn't really need to be  
persisted over the entire application.

Does anyone have any thoughts on how to accomplish this?

Thanks for the help,

Kevin

Reply via email to