title: Cannot set CornerRadius value from static resource
body: <p>I have defined a static resource: </p>
  
  <pre><code>&lt;UserControl x:Class="MyProject.MainPage"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:sys="clr-namespace:System;assembly=mscorlib" 
     mc:Ignorable="d" 
     Width="255" 
     Height="300"&gt;
  
     &lt;UserControl.Resources&gt;
        &lt;sys:Double x:Key="CornerRadiusValue"&gt;5&lt;/sys:Double&gt;
     &lt;/UserControl.Resources&gt;
  ...
  </code></pre>
  
  <p>Later on in XAML file, I am trying to use that value when setting top left corner radius for a border: </p>
  
  <pre><code>&lt;Border 
     Width="40"
     Height="30"
     BorderThickness="1,1,0,0" 
     BorderBrush="Red"&gt;
        &lt;Border.CornerRadius&gt;
           &lt;CornerRadius TopLeft="{StaticResource CornerRadiusValue}" /&gt;
        &lt;/Border.CornerRadius&gt;
  &lt;/Border&gt;
  </code></pre>
  
  <p>In design time, everything works fine and changing the value for <code>CornerRadiusValue</code> static resource changes the corner radius on a border. However, when I want to run this, I get an <code>XamlParseException</code> exception with the message: </p>
  
  <blockquote>
    <p>Cannot set read-only property `System.Windows.CornerRadius.TopLeft'.</p>
  </blockquote>
  
  <p>What am I doing wrong? How do I make it work? Thanks. </p>