Hi,
I am using the datafilter in the mvvm pattern, with the filter collection data stored in the viewmodel, which is then used to build a query to run against a WCF Data Services / OData IQueryable entity. I'm not connecting the datafilter to another itemscontrol to be populated with ItemProperties, but rather creating my own item properties via reflection and linq off the entity type.
One issue is that I cannot bind to the FilterDescriptors property of the datafilter as it is readonly, so instead I am using a bit of code-behind code to persist this collection between the view and viewmodel when the datacontext changes.
The inability to bind to FilterDescriptors is causing one problem, which is why I am posting here. I am saving/loading the filter data to/from a database, and would like to know when the data becomes 'dirty' (so that i can indicate visually that the data should be saved). This is ok for filters being added or removed (via the CollectionChanged event) or for the logical operator being changed (via the PropertyChanged event), but I cannot find any way of detecting when the value of any of the simple filter properties (Member, Operator or MemberValue) have changed.
I've tried adding handlers for all sorts of events on the datafilter and on its viewmodel, but none of the handlers are hit when editing the filters. I have even looped through the RadDataFilter.ViewModel.CompositeFilter.Filters collection, adding handlers for each item's PropertyChanged event, but still nothing.
So, is there something I can do that I have missed - or - can an event be added when these simple filter values are changed, or can the FilterDescriptors property on the control be made bindable?
Thanks.
I am using the datafilter in the mvvm pattern, with the filter collection data stored in the viewmodel, which is then used to build a query to run against a WCF Data Services / OData IQueryable entity. I'm not connecting the datafilter to another itemscontrol to be populated with ItemProperties, but rather creating my own item properties via reflection and linq off the entity type.
One issue is that I cannot bind to the FilterDescriptors property of the datafilter as it is readonly, so instead I am using a bit of code-behind code to persist this collection between the view and viewmodel when the datacontext changes.
The inability to bind to FilterDescriptors is causing one problem, which is why I am posting here. I am saving/loading the filter data to/from a database, and would like to know when the data becomes 'dirty' (so that i can indicate visually that the data should be saved). This is ok for filters being added or removed (via the CollectionChanged event) or for the logical operator being changed (via the PropertyChanged event), but I cannot find any way of detecting when the value of any of the simple filter properties (Member, Operator or MemberValue) have changed.
I've tried adding handlers for all sorts of events on the datafilter and on its viewmodel, but none of the handlers are hit when editing the filters. I have even looped through the RadDataFilter.ViewModel.CompositeFilter.Filters collection, adding handlers for each item's PropertyChanged event, but still nothing.
So, is there something I can do that I have missed - or - can an event be added when these simple filter values are changed, or can the FilterDescriptors property on the control be made bindable?
Thanks.