title: Putting a ContentControl *inside* a WPF DataTemplate?
body: <p>I have a custom Expander control called <code>SpecialExpander</code>. It is basically just a standard <code>Expander</code> with a fancy header and a couple properties (<code>HeaderText</code> and <code>IsMarkedRead</code>).</p>
  
  <p>I began by creating a simple class:</p>
  
  <pre><code>public class SpecialExpander : Expander
  {
      public string HeaderText { get; set; }
      public bool IsMarkedRead { get; set; }
  }
  </code></pre>
  
  <p>Then I created a style that sets a couple properties on the expander (e.g., margins, padding, etc.) and, importantly, it also defines a custom <code>DataTemplate</code> for the <code>HeaderTemplate</code> property. The template is basically a grid with two rows.</p>
  
  <p>As shown in the illustrations below...</p>
  
  <ul>
  <li>for the top row, I'd like a fixed layout (it's always <code>TextBlock</code> <code>TextBlock</code> <code>CheckBox</code>)</li>
  <li>for the bottom row, however, I want to be able to provide custom XAML for each expander.</li>
  </ul>
  
  <p>I tried putting <code>&lt;ContentControl Grid.Row="1" ... /&gt;</code> in the <code>DataTemplate</code>, but I couldn't figure out how to hook it up properly.</p>
  
  <hr>
  
  <p><a href="http://img85.imageshack.us/img85/1194/contentcontrolwithintem.jpg" rel="nofollow noreferrer">alt text http://img85.imageshack.us/img85/1194/contentcontrolwithintem.jpg</a></p>
  
  <hr>
  
  <p><a href="https://i.stack.imgur.com/NK3bg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NK3bg.jpg" alt="alt text"></a>
  </p>
  
  <hr>
  
  <p><strong>Question</strong></p>
  
  <p>How can I build a <code>DataTemplate</code> for my <code>SpecialExpander</code> so that the header has some fixed content (top row) and a place-holder for custom content (bottom row)?</p>
  
  <p>For the second illustration, I would want to be able to do something like this:</p>
  
  <pre><code>&lt;SpecialExpander HeaderText="&lt;Expander Header Text&gt;" IsMarkedRead="True"&gt;
      &lt;SpecialExpander.Header&gt;
          &lt;StackPanel Orientation="Horizontal"&gt;
              &lt;RadioButton Content="High" /&gt;
              &lt;RadioButton Content="Med" /&gt;
              &lt;RadioButton Content="Low" /&gt;
          &lt;/StackPanel&gt;
      &lt;SpecialExpander.Header&gt;
      &lt;Grid&gt;
          &lt;Label&gt;Main Content Goes Here&lt;/Label&gt;
      &lt;/Grid&gt;
  &lt;/SpecialExpander&gt;
  </code></pre>