title: MVVM: Binding to Model while keeping Model in sync with a server version
body: <p>I've spent quite some time to try and find an elegant solution for the following challenge. I've been unable to find a solution that's more than a hack around the problem.</p>
  
  <p>I've got a simple setup of a View, ViewModel and a Model. I will keep it very simple for the sake of explanation. </p>
  
  <ul>
  <li>The <code>Model</code> has a single property called <code>Title</code> of type String. </li>
  <li>The <code>Model</code> is the DataContext for the <code>View</code>. </li>
  <li>The <code>View</code> has a <code>TextBlock</code> thats databound to <code>Title</code> on the Model.</li>
  <li>The <code>ViewModel</code> has a method called <code>Save()</code> that will save the <code>Model</code> to a <code>Server</code></li>
  <li>The <code>Server</code> can push changes made to the <code>Model</code></li>
  </ul>
  
  <p>So far so good. Now there are two adjustments I need to make in order to keep the Model in sync with a <code>Server</code>. The type of server is not important. Just know that I need to call <code>Save()</code> in order to push the Model to  the <code>Server.</code></p>
  
  <p><strong>Adjustment 1:</strong></p>
  
  <ul>
  <li>The <code>Model.Title</code> property will need to call <code>RaisePropertyChanged()</code> in order to translate changes made to the <code>Model</code> by the <code>Server</code> to the <code>View</code>. This works nicely since the <code>Model</code> is the DataContext for the <code>View</code></li>
  </ul>
  
  <p>Not too bad.</p>
  
  <p><strong>Adjustment 2:</strong></p>
  
  <ul>
  <li>Next step is to call <code>Save()</code> to save changes made from the <code>View</code> to the <code>Model</code> on the <code>Server</code>. This is where I get stuck. I can handle the <code>Model.PropertyChanged</code> event on the <code>ViewModel</code> that calls Save() when the Model gets changed but this makes it echo changes made by the Server.</li>
  </ul>
  
  <p>I'm looking for an elegant and logical solution and am willing to change my architecture if it makes sense.</p>