title: Bind the ItemsSource of a DataGrid to a List
body: <p>I am trying to create a binding between a <code>List</code> and a <code>DataGrid</code>. I haven't found a working Solution in the net which is very strange. </p>
  
  <p>In my little example I create a <code>List</code> of objects with the two <code>public</code> properties <code>Age</code> and <code>Name</code>:</p>
  
  <pre><code>public class Person
  {
      public string Name { get; set; }
  
      public int Age { get; set; }
  }
  
  public ObservableCollection&lt;Person&gt; Collection { get; set; } 
  
  public List&lt;Person&gt; Persons { get; set; }
  
  private void WindowLoaded(object sender, RoutedEventArgs e)
  {
  
      this.Persons = new List&lt;Person&gt;();
  
      for (int i = 0; i != 35; i++)
      {
          this.Persons.Add(new Person() {Age = i, Name = i.ToString()});
      }
  
      this.Collection = new ObservableCollection&lt;Person&gt;(this.Persons);
  }
  </code></pre>
  
  <p>The XAML Code looks like this:</p>
  
  <pre><code>&lt;Grid DataContext="{Binding ElementName=TestWindow, Path=.}"&gt;
      &lt;DataGrid x:Name="DataGrid" ItemsSource="{Binding Collection}" /&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>or this (both is not working):</p>
  
  <pre><code>&lt;Grid DataContext="{Binding ElementName=TestWindow, Path=.}"&gt;
          &lt;DataGrid x:Name="DataGrid" ItemsSource="{Binding Persons}" /&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>if I use <code>this.DataGrid.ItemsSource = this.Persons;</code> I see at least all the items in the list but I have to <code>this.DataGrid.Items.Refresh()</code> every time the Source <code>List</code> changes which is the reason why I ask the question:</p>
  
  <p>What am I doing wrong? Do I need to implement <code>INotifyPropertyChanged</code>?</p>
  
  <p>This question must be very easy to answer but it would be also awesome to understand the mechanics.</p>