title: Bind with WindowsFormsHost
body: <p>I am trying to bind a List of items to a TabControl. The items look like:</p>
  
  <pre><code>class SciEditor
  {
      private Scintilla editor = null;
      public System.Windows.Forms.Control Editor
      {
          get { return editor; }
      }
  
      private string path = null;
      public string ShortName
      {
          get
          {
              return null == path ? "New Script" : Path.GetFileNameWithoutExtension(path);
          }
      }
      ....
  </code></pre>
  
  <p>In my main window, the List is called "allScripts". Here's the XAML:</p>
  
  <pre><code>&lt;TabControl Grid.Row="0" Grid.Column="0" Name="tabControl1"&gt;
              &lt;TabControl.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBlock&gt;                            
                          &lt;TextBlock Text="{Binding ShortName}"/&gt;
                      &lt;/TextBlock&gt;
                  &lt;/DataTemplate&gt;
              &lt;/TabControl.ItemTemplate&gt;
              &lt;TabControl.ContentTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;WindowsFormsHost Child="{Binding Editor}" /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/TabControl.ContentTemplate&gt;
  &lt;/TabControl&gt;
  </code></pre>
  
  <p>The problem is I can't set "Child" in WindowsFormsHost because </p>
  
  <blockquote>
    <p>A 'Binding' cannot be set on the 'Child' property of type 'WindowsFormsHost'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.</p>
  </blockquote>
  
  <p>How can I set the WindowsFormsHost child?</p>
  
  <p>EDIT: forgot to mention, in the main window constructor I have:</p>
  
  <pre><code>tabControl1.ItemsSource = allScripts;
  </code></pre>