title: WPF ComboBox binding ItemsSource
body: <p>I'm a beginner on WPF and trying to bind the Items of a ComboBox to an ObservableCollection</p>
  
  <p>I used this code:</p>
  
  <p>XAML</p>
  
  <pre><code>&lt;Window x:Class="comboBinding2.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          DataContext="{Binding RelativeSource={RelativeSource Self}}"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Grid&gt;
          &lt;ComboBox x:Name="cmbTest" ItemsSource="{Binding Path=cmbContent}" Width="200" VerticalAlignment="Center" HorizontalAlignment="Center" /&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>C#</p>
  
  <pre><code>public MainWindow()
  {
      cmbTest.ItemsSource = cmbContent;
      cmbContent.Add("test 1");
      cmbContent.Add("test 2");
  
      InitializeComponent();
  }
  
  public ObservableCollection&lt;string&gt; cmbContent { get; set; }
  </code></pre>
  
  <p>I don't get any errors on this Code until I try to debug, it throws the error:</p>
  
  <p>TargetInvocationError</p>
  
  <p>An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in PresentationFramework.dll</p>
  
  <p>Can anybody tell me what I'm doing wrong?</p>