How can I define a message attach from code behind

Apr 3, 2012 at 7:04 AM

Hello,

I need to persist gridview settings and using telerik I was able to do so.... on the loaded I check if there's a stored setting and I load it , on unload I store the settings to isolated storage... I wish to port it to mvvm pattern so I decided to attach 2 message one for Event Load and one for event Unload passing the whole view as parameter to the viewmodel.... how can I specify this in the code behind so I can put this code in a middle class that wraps the UserControl?

Thanks

Apr 3, 2012 at 9:38 PM

you could grab an instance of your datacontext in the codebehind, which is the viewmodel, this can give you access to the methods in the viewmodel to do the persisting... or since its a "VIEW" related item just do it from the view.  View items storing "settings" shouldn't be a purity issue...  Hell use the telerik persistanceframework...

Apr 5, 2012 at 7:47 AM

hello mvermef,

I've done as you suggested.... It works... do you regularly use telerik persistance framework? I got some problem with master-detail grid on detail.... are you ware of any other persistence framework I can use?

Thanks