Save View Model on Close with TabControl

Apr 20, 2012 at 9:58 PM

In Silverlight 5 we have a TabControl with various UserControls on each tab.  As you know, the TabControl unloads all the views when leaving a tab, which results in all the view models being closed.  However, this does not end the IEditableObject session on the model objects through save or cancel.  What is the best practice for getting around this?

Coordinator
Apr 21, 2012 at 6:50 AM

Interesting, the user control calls CloseAndDisposeViewModel. However, it should call either true or false instead of indeterminate. I will take a look at this. For now, you can call Save when overriding OnCloseViewModel.

This fix will be available in the next version.

May 8, 2012 at 6:33 PM

3.1 does not appear to fix the issue.  Passing 'true' to CloseAndDisposeViewModel() does not result in saving the view model.

Coordinator
May 9, 2012 at 6:23 PM

Hmmm, can you please create a small repro with your issue and upload it here:

http://catel.codeplex.com/workitem/list/advanced