title: Creating a silverlight border in codebehind?
body: <p>I have the following border in XAML:</p>
  
  <pre><code>&lt;Border
      Grid.Column="0"
      Grid.ColumnSpan="3"
      Grid.RowSpan="3"
      CornerRadius="1,1,1,1"
      Background="Red"
      BorderBrush="#333333"
      BorderThickness="1,1,1,1"
      x:Name="border"
      RenderTransformOrigin="0.5,0.5"&gt;
      &lt;Border.RenderTransform&gt;
          &lt;TransformGroup&gt;
              &lt;ScaleTransform /&gt;
              &lt;SkewTransform /&gt;
              &lt;RotateTransform /&gt;
              &lt;TranslateTransform /&gt;
          &lt;/TransformGroup&gt;
      &lt;/Border.RenderTransform&gt;
      &lt;ContentPresenter
          x:Name="contentPresenter"
          Margin="10,0,10,0"
          ContentTemplate="{TemplateBinding ContentTemplate}"
          VerticalAlignment="Center"
          HorizontalAlignment="Center" /&gt;
  &lt;/Border&gt;
  </code></pre>
  
  <p>and I'm trying to create a similar border in code behind (C#). I can't get beyond <code>Border b = new Border()</code>, I'm not sure how I'm supposed to put the border inside the specific grid column or how to span it.</p>
  
  <p>Any ideas?</p>