title: How to make a WPF DataGrid display a ViewModel collection with binding and a DataTemplate
body: <p>First off, an apology as I am sure this is question's answer is quite simple.  Nonetheless I still cannot seem to find an answer.</p>
  
  <p>This is my first week using WPF.  I simply wish to display the contents of some sort of list inside of a DataGrid.  I am currently trying to use an ObservableCollection&lt;> and a DataGrid, but that can change.  How do I DataTemplate the list and display it?</p>
  
  <p>The list is in a ViewModel, which has been set in Apps.xaml.cs as the DataSource for the MainWindow.xaml:</p>
  
  <pre class="lang-cs prettyprint-override"><code>protected override void OnStartup(StartupEventArgs e)
  {
      base.OnStartup(e);
  
      var window = new MainWindow();
  
      // Create the ViewModel to which 
      // the main window binds.
      var viewModel = new MainWindowViewModel();
  
      // Allow all controls in the window to 
      // bind to the ViewModel by setting the 
      // DataContext, which propagates down 
      // the element tree.
      window.DataContext = viewModel;
  
      window.Show();
  }
  </code></pre>
  
  <p>Here is the current list:</p>
  
  <pre class="lang-cs prettyprint-override"><code>    public ObservableCollection&lt;PersonData&gt; SearchResults { get; set; }
  </code></pre>
  
  <p>As for my xaml, though, I am rather lost -- I've tried fiddling around with binding and ItemsSource, and really have no idea how to use them here.  Also, I suppose using a DataTemplate will be necessary, as I need to let it know somehow that the columns need to display certain properties of the PersonData, such as first and last name, location, and title.  Any help is appreciated.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>More generally -- how does one simply display a ViewModel list, collection, what have you, period?</p>