This project has moved. For the latest updates, please go here.

Question on the Model ViewModel wire up in the ToDoList reference application

Oct 18, 2013 at 10:38 PM
I have read through the book and looked over the example code, but I have one question related to the OnCommitted / Save / Reset (On Cancel) process.

In looking at the example EditViewModel from the Chapter 13 Final ToDoList project it looks like you are duplicating all of the model properties with the exception of CompletedDate and IsComplete; my guess is that this is done so that you can refresh the data if needed and so that you can manage validations at the viewmodel level.

My question is: Is this the only way to manage this? Could I just create a clone of the Model at the ViewModel to manage the reset side of things if the user decided to reset. Also could the PropertyChanged events from the Model bubble up to the View Validation if I manage validation in the Model? I do see an issue here with the BaseEntityViewModel ClearErrors, SetErrors, and possibly the ValidateAll method, but I am guessing that these could all be pushed down to the model if needed, but I am not sure if that is a good practice or not.