title: Correct way to bind IEnumerable MVVM property that isn't an observable collection
body: <p>Say I have this domain entity:</p>
  
  <pre><code>public class Foo
  {
      public string Name { get; set; }
      public IEnumerable&lt;Bar&gt; Bars { get; set; }
  }
  </code></pre>
  
  <p>Now let's say I need to bind the <code>Bars</code> property to a datagrid in a WPF/MVVM app. What is the appropriate way to notify the view that the <code>Bars</code> property changed? I see a few options:</p>
  
  <ol>
  <li>Change Bars to be an ObservableCollection</li>
  <li>Create a new property, on the view model, that is an ObservableCollection that is a copy of the real Bars.</li>
  <li>Refresh the entire view</li>
  <li>Something else/better?</li>
  </ol>
  
  <p>I could do #1, but I don't like the needs of the view to cause a domain entity to change.</p>
  
  <p>Number 2 seems ok, but a bit hackish.</p>
  
  <p>Number 3 seems inefficient.</p>
  
  <p>What's the best way?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>For completeness, based on Simon's answer, I did this:</p>
  
  <pre><code>    public Foo SelectedFoo
      {
          get { return _selectedFoo; }
          set
          {
              _selectedFoo = value;
              this.NotifyPropertyChanged(() =&gt; this.Foo);
  
              _bars = new ObservableCollection&lt;Bar&gt;();
              if (_selectedFoo.Bars != null) { _bars.AddRange(_selectedFoo.Bars); }
              this.NotifyPropertyChanged(() =&gt; this.Bars);
          }
      }
  
      private ObservableCollection&lt;Bar&gt; _bars;
  
      public ObservableCollection&lt;Bar&gt; Bars
      {
          get { return _bars; }
      }
  </code></pre>