title: Changing WPF StackPanel template
body: <p>I am trying to create a custom style panel (<code>StyledStackPanel</code>) which is identical to regular StackPanel, that has a custom style.
  For example - if the style is simply to add an underline, by writing:</p>
  
  <pre><code>&lt;StyledStackPanel&gt;
      &lt;!--User content goes here--&gt;
  &lt;/StyledStackPanel&gt;
  </code></pre>
  
  <p>I would like to receive the same appearance as if I wrote:</p>
  
  <pre><code>&lt;StackPanel&gt;
      &lt;!--User content goes here--&gt;
  &lt;/StackPanel&gt;
  &lt;Border Height="1" BorderBrush="Blue"/&gt;
  </code></pre>
  
  <p>If <code>StackPanel</code> was a <code>Control</code>, I could have replace the <code>DataTemplate</code> of that control. However, it inherits <code>Panel</code> which inherits <code>FrameworkElement</code>. <br/>Is there a way to change the template of a <code>StackPanel</code>?</p>