title: button inside border
body: <p>I have a problem with a button inside a border. I want the button to fill the button space inside a border but the button is placed above the border and not under the border. And this way it hides the corder radius made by the border.</p>
  
  <p>Here is a picture of my problem:</p>
  
  <p><img src="https://i.stack.imgur.com/z4kIX.png" alt="enter image description here"></p>
  
  <p>Someone knows how to put the button below the border?</p>
  
  <p>Here is my xaml for my button:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Button Name="filterCustomerBtn" 
          Command="{Binding Path=UpdateDepartments}" 
          Style="{StaticResource defaultButtonStyle}" 
          Width="200" 
          Margin="0, 15, 0, 0" 
          HorizontalAlignment="Center"&gt;Filter now&lt;/Button&gt;
  </code></pre>
  
  <p>Here is the relevant xaml code:</p>
  
  <pre><code>&lt;Window.Resources&gt;
      &lt;Style x:Key="defaultButtonStyle" TargetType="Button"&gt;
          &lt;Setter Property="Margin" Value="2"&gt;&lt;/Setter&gt;
      &lt;/Style&gt;
  &lt;/Window.Resources&gt;
  
  
  &lt;StackPanel Orientation="Vertical" DockPanel.Dock="Top"&gt;
      &lt;Border Style="{StaticResource MainBorderStyle}" Margin="2" Background="LightBlue"&gt;
          &lt;StackPanel Orientation="Vertical" VerticalAlignment="Center"&gt;
              &lt;Button Name="filterCustomerBtn" Command="{Binding Path=UpdateDepartments}" Style="{StaticResource defaultButtonStyle}" Width="200" Margin="0, 15, 0, 0" HorizontalAlignment="Center" Panel.ZIndex="-1"&gt;Filter now&lt;/Button&gt;
          &lt;/StackPanel&gt;
      &lt;/Border&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <h1>Result Image</h1>
  
  <p><img src="https://i.stack.imgur.com/yjyQZ.png" alt="enter image description here"></p>