title: Create the same border type around all my controls
body: <p>I tried to create my own Border class and then insert it in my controls but then it seems I cannot assign names to everything inside the borders:</p>
  
  <pre><code>..
  &lt;my:ElementBorder&gt;
          &lt;StackPanel Name="ifBlock" Background="#E0E8FF" /&gt;
  &lt;/my:ElementBorder&gt; 
  ..
  </code></pre>
  
  <p>How can I get around this? Can I use templating somehow for that?</p>
  
  <p>EDIT:
  Sorry that I was unclear. Yes I subclassed Border with my own XAML file and got this compiler error with the code above:</p>
  
  <blockquote>
    <p>Error 2   Cannot set Name attribute
    value 'ifBlock' on element
    'StackPanel'. 'StackPanel' is under
    the scope of element 'ElementBorder',
    which already had a name registered
    when it was defined in another scope.</p>
  </blockquote>
  
  <p>The contents of my ElementBorder class aren't very interesting but I'll post it anyway:</p>
  
  <pre><code>&lt;Border x:Class="DVPE.ElementBorder"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      BorderThickness="4" 
      CornerRadius="4"&gt;
  &lt;/Border&gt;
  </code></pre>