title: Adding additional controls above a ComboBox's ItemsPanel
body: <p>I want to make a searchable <code>ComboBox</code>, with the search box being a <code>TextBox</code> that appears above the <code>ItemsPanel</code> when the <code>ComboBox</code> dropdown is expanded.  I think I need to make a custom control to achieve the search functionality, but first I'm just trying to get the <code>TextBox</code> to show up using a normal <code>ComboBox</code>. Here's my current attempt, which is generating an exception when I try to expand the dropdown:</p>
  
  <pre><code>&lt;Style x:Key="FilteredComboBox" TargetType="ComboBox"&gt;
      &lt;Setter Property="ItemsPanel"&gt;
          &lt;Setter.Value&gt;
              &lt;ItemsPanelTemplate&gt;
                  &lt;StackPanel&gt;
                      &lt;TextBox/&gt;
                      &lt;StackPanel IsItemsHost="True"
                                  Orientation="Horizontal"
                                  VerticalAlignment="Center"
                                  HorizontalAlignment="Center"/&gt;
                      &lt;/StackPanel&gt;
  
              &lt;/ItemsPanelTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>The exception this is generating is:</p>
  
  <blockquote>
    <p>Cannot explicitly modify Children collection of Panel used as ItemsPanel for ItemsControl. ItemsControl generates child elements for Panel.</p>
  </blockquote>
  
  <p>I'm pretty sure there's a way to make this do what I want, but after several hours of googling and trial and error my head is now spinning.  Any help would be greatly appreciated!</p>