title: Editing ObservableCollection's SelectedItem Without Bound Controls Seeing Edits Until They Are Saved
body: <p>I have a view containing a <code>ListView</code> and an "Edit" Button. The ListView's <code>ItemSource</code> is bound to an <code>ObservableCollection&lt;Account&gt;</code> property on the underlying view model. Its <code>SelectedItem</code> property is also bound to the view model. </p>
  
  <p>When the edit button is clicked, the existing view model launches an editing  view/view model pair ("editing screen") allowing the user to edit the currently selected <code>Account</code>. The <code>Account</code> to edit is determined by the main view model's <code>SelectedItem</code> property.</p>
  
  <p><strong>Problem:</strong> Any changes made in the editing screen are immediately reflected in the other screen's <code>ListView</code>, even before the edit screen's "Save" button is clicked. Why this happens makes sense--<code>Account</code> is raising property change events when its properties are changed and the <code>ListView</code> is processing those notifications.</p>
  
  <p><strong>Desired Outcome:</strong> Bound controls (like the <code>ListView</code>) should only see editing screen changes  after"Save" is clicked.</p>
  
  <h2>Possible Solutions</h2>
  
  <ul>
  <li>Suspend Account's property change notifications while editing is underway. Disadvantages: If a manual data-binding update is performed while an <code>Account</code> instance is being edited, the "in-progress" changes will appear on the <code>ListView</code> even though those changes haven't been raising notifications. Also, if the user launches a second edit window for the same <code>Account</code>, they will see the "in-progress" changes. Idea rejected.</li>
  <li>Have the editing screen view model wrap the <code>Account</code> instance in some kind of <code>EditingAccount</code> class that copies changes made to it back to the original <code>Account</code> only when <code>Save()</code> is called. Should the editing screen take on the responsibility of facilitating this wrapping or should it ask the service layer to do it?</li>
  </ul>
  
  <p>What do you think of these options? How do you solve this problem when you encounter it?</p>