Assume I have a model which offers me a property, which is list of custom objects. The model is a singleton and I give the reference of this property to the ViewModel. These custom objects have for example boolean properties. Now the user changes these values by clicking in the view and operating on the references in the model. Thus the list in my model does not change and therefore the model can not notify other views unless I implement event handling for every list member.
On the other hand side my model notifies others if I assign a complete new list.
The question is: is it in general good idea to work on the references of my model or should every ViewModel make a deep copy of the list content and assign later a complete new list to the model. And if not should I add event handling for every member of the list in my model?
Btw. the ObservableCollection is no option because it does not detect item changes and I think a general model should use the Ilist interface.
There is no straighforward answer to your question, it is all a matter of how you want your application to behave.
If you want any changes made by the user to be immediately effective in the application, then you should work directly on the references returned by your model. But on the user hand, you have to handle the cases where the application has the initiative to make changes to the list and notify the user.
On the other hand, if you prefer that any modification made by the user has to be validated by the push of a “Apply changes” button, the option of cloning the list is probably the best choice.