title: Trying to rotate text for a groupbox
body: <p>I'm trying to create a groupbox-like element in XAML (for a Silverlight 2 app) but with a twist. </p>
  
  <p>Normally a groupbox would consist of a border, with the main content placed inside the border, and a header content placed over the border itself.</p>
  
  <p>What I'm trying to do is place the header text over the left side border, rotated 270 degrees and justified at the top. But my brain hurts from trying to figure out the rotate transform.</p>
  
  <p>Here's my ControlTemplate for the existing Groupbox, which I'd like to change:</p>
  
  <pre><code>&lt;ControlTemplate TargetType="Controls1:GroupBox"&gt;
    &lt;Grid Background="{TemplateBinding Background}"&gt;
      &lt;Grid.RowDefinitions&gt;
        &lt;RowDefinition Height="Auto"/&gt;
        &lt;RowDefinition Height="Auto"/&gt;
        &lt;RowDefinition Height="*"/&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Border BorderThickness="{TemplateBinding BorderThickness}" Grid.Row="1" Grid.RowSpan="2" 
              BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="3"&gt;
        &lt;Border.Clip&gt;
          &lt;GeometryGroup FillRule="EvenOdd"&gt;
            &lt;RectangleGeometry x:Name="FullRect" Rect="0,0,300,200"/&gt;
            &lt;RectangleGeometry x:Name="HeaderRect" Rect="6,0,100,100"/&gt;
          &lt;/GeometryGroup&gt;
        &lt;/Border.Clip&gt;
      &lt;/Border&gt;
      &lt;ContentPresenter Grid.Row="2" ContentTemplate="{TemplateBinding ContentTemplate}" 
                        Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"/&gt;
      &lt;ContentControl x:Name="HeaderContainer" Margin="6,0,0,0" Grid.Row="0" Grid.RowSpan="2" HorizontalAlignment="Left" IsEnabled="False" &gt;
        &lt;ContentPresenter Margin="3,0,3,0" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" /&gt;
      &lt;/ContentControl&gt;
    &lt;/Grid&gt;
  &lt;/ControlTemplate&gt;
  </code></pre>
  
  <p>Any help much appreciated!</p>