title: wpf usercontrol, border cornerradius not working
body: <p>I have a usercontrol that is surrounded with a bordercontrol. What I want is that I can set the borderbrush through a property when I am placing the control. I can set the color of the border but the problem is that the cornerradius is not working. The only way it works is if I set the borderbrush in the usercontrol itself.
  Evertything else is working just fine. I can set the text properties for the labels and the image property for the Image but I cannot find out why the cornerradius is not working.</p>
  
  <pre><code>    &lt;UserControl x:Class="CoinManager.Controls.AltCoinButton"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           xmlns:local="clr-namespace:CoinManager.Controls"
           mc:Ignorable="d" 
           d:DesignHeight="80" Width="80"&gt;
  &lt;Border Name="crtBorder" 
          BorderThickness="1" 
          Padding="5"
          CornerRadius="5"    
          BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"&gt;
      &lt;Grid&gt;
              &lt;StackPanel HorizontalAlignment="Center"&gt;
                  &lt;Image Source="{Binding Path=ImageSource, RelativeSource={RelativeSource FindAncestor, AncestorType=local:AltCoinButton, AncestorLevel=1}}" 
                 Height="25" Width="25"
                 /&gt;
                  &lt;Label Content="{Binding Path=ContentCoinType, RelativeSource={RelativeSource FindAncestor, AncestorType=local:AltCoinButton, AncestorLevel=1}}"
                  Foreground="#FAFAFA"
                  HorizontalContentAlignment="Center" Margin="0,5,0,0"
                 FontFamily="Segoe UI"/&gt;
                  &lt;Label Content="{Binding Path=ContentCoinValue, RelativeSource={RelativeSource FindAncestor, AncestorType=local:AltCoinButton, AncestorLevel=1}}"
                 Foreground="#FAFAFA"
                 HorizontalContentAlignment="Center" Margin="0,-10,0,0"
                 FontFamily="Segoe UI"/&gt;
              &lt;/StackPanel&gt;
          &lt;/Grid&gt;
  &lt;/Border&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is the code in my custom project.</p>
  
  <pre><code>    &lt;Controls:AltCoinButton x:Name="btcButton"
          Height="80"
          Width="80" ImageSource="{StaticResource BtcLogo}"
          BorderBrush="#FF9900" 
          ContentCoinType="Bitcoin" 
          ContentCoinValue="€ 1544,23" 
          HorizontalAlignment="Left" 
          Margin="186,50.254,0,0" 
          VerticalAlignment="Top" d:LayoutOverrides="Width, Height"/&gt;
  </code></pre>
  
  <p>Can anyone of you help me out?</p>