title: Good way to refresh databinding on all properties of a ViewModel when Model changes
body: <h2>Short Version</h2>
  
  <p>If I update the Model object that my ViewModel wraps, what's a <em>good</em> way to fire property-change notifications for all the model's properties that my ViewModel exposes?</p>
  
  <h2>Detailed Version</h2>
  
  <p>I'm developing a WPF client following the MVVM pattern, and am attempting to handle incoming updates, from a service, to data being displayed in my Views. When the client receives an update, the update appears in the form of a DTO which I use as a Model. </p>
  
  <p>If this model is an update to an existing model being shown in the View, I want the associated ViewModel to update its databound properties so that the View reflects the changes. </p>
  
  <p>Let me illustrate with an example. <strong>Consider my Model:</strong></p>
  
  <pre><code>class FooModel
  {
    public int FooModelProperty { get; set; }
  }
  </code></pre>
  
  <p><strong>Wrapped in a ViewModel:</strong></p>
  
  <pre><code>class FooViewModel
  {
    private FooModel _model;
  
    public FooModel Model 
    { 
      get { return _model; }
      set 
      { 
        _model = value; 
        OnPropertyChanged("Model"); 
      }
    }
  
    public int FooViewModelProperty
    {
      get { return Model.FooModelProperty; }
      set 
      {
        Model.FooModelProperty = value;
        OnPropertyChanged("FooViewModelProperty");
      }    
  }
  </code></pre>
  
  <p><strong>The Problem:</strong></p>
  
  <p>When an updated model arrives, I set the ViewModel's Model property, like so:</p>
  
  <pre><code>instanceOfFooVM.Model = newModel;
  </code></pre>
  
  <p>This causes <code>OnPropertyChanged("Model")</code> to fire, but not <code>OnPropertyChanged("FooViewModelProperty")</code>, unless I call the latter explicitly from <code>Model</code>'s setter. So a View bound to <code>FooViewModelProperty</code> won't update to display that property's new value when I change the Model.</p>
  
  <p>Explicitly calling <code>OnPropertyChanged</code> for every exposed Model property is obviously not a desirable solution, and neither is taking the <code>newModel</code> and iterating through its properties to update the ViewModel's properties one-by-one. </p>
  
  <p>What's a better approach to this problem of updating a whole model and needing to fire change notifications for all its exposed properties?</p>