title: Detecting if an ObservableCollection has been modified
body: <p>I have a DataGrid nested in a DockPanel. The DockPanel serves as a data context:</p>
  
  <pre><code>DockPanel1.DataContext = GetData();
  </code></pre>
  
  <p>The GetData() method returns an ObservableCollection.</p>
  
  <p>The ObservableCollection can be modified in the DataGrid as well as in a few textboxes nested in the DockPanel. I also navigate through the collection using a DataView.</p>
  
  <p>I'd like to detect if the collection has been modified and warn a user when he/she tries to close the application without saving data.</p>
  
  <p>Is there any built-in mechanism that I could use (a kind of "IsDirty" flag on the collection or on the view)? If not, I guess I will have to monitor all the controls and detect any changes manually.</p>
  
  <p>Thanks,
  Leszek</p>