title: designing model in MVVM and WPF and state management
body: <p>In my WPF app, I am using MVVM. I am reading from an XML file, deserialize it to an object model and keeping it in memory. </p>
  
  <p>XML File->BusinessObjectModel(Model)->ViewModel</p>
  
  <p>Whenever the viewmodel needs the model I will provide it from the memory.My problem is when I use the model elements in the views it is updating the model in memory(obviously!). I dont want to do that, I want the model updated only when the user clicks OK in the view(or dialog). How is it usually achieved? Should I only provide the viewmodel a clone of the model and not the original reference? </p>