title: Binding a List<MyObject> to a DataGrid? When I try I get a "TargetInvocationException"
body: <p>I'm trying to bind a <code>List&lt;MyObject&gt;</code> to a DataGrid in WPF instead of using an array of <code>MyObject[]</code>. Whenever I try and do this I get an unhandled <code>TargetInvocationException</code>.</p>
  
  <p>My Object:</p>
  
  <pre><code>public class Website
  {
      public string WebsiteName { get; set; }
      public string WebsiteAddress { get; set; }
      private LoginCredentials Credentials { get; set; }
  
      public bool UniquePassword { get; set; } //If uses uses a unique password on this site
      public bool LoginToSite { get; set; }
      public bool UsesUsernameAndDomain { get; set; }
  
      public string GetUsername()
      {
          if(UsesUsernameAndDomain)
          {
              return Credentials.Username + "@" + Credentials.EmailDomain;
          }
          else
          {
              return Credentials.Username;
          }
      }
  
      public void SetUsername(string value)
      {
          Credentials.Username = value;
      }
  
      public void SetDomain(string value)
      {
          Credentials.EmailDomain = value;
      }
  }
  </code></pre>
  
  <p>The ViewModel snippet:</p>
  
  <pre><code>    private List&lt;Website&gt; m_Websites;
      public List&lt;Website&gt; Websites
      {
          get { return m_Websites; }
          set { m_Websites = value; RaisePropertyChanged("Websites"); }
      }
  </code></pre>
  
  <p>XAML:</p>
  
  <pre><code>        &lt;DataGrid ItemsSource="{Binding}"
                    DataContext="{Binding Websites}"
                    AutoGenerateColumns="False"
                    FontSize="14"
                    VerticalAlignment="Center"
                    VerticalContentAlignment="Center"&gt;
  </code></pre>
  
  <p>When I try this with an array it functions as expected. I want to use a collection for the additional behavior that it comes packaged with. What am I doing wrong here?</p>
  
  <p>Note: I am very new to WPF, and only recently puzzled my way though data binding, do not assume I know the ins and outs of WPF or it's paradigms.</p>