为什么我的文字会被裁剪?

3 wpf user-interface xaml

当我尝试将文本块添加到边框元素时,我只看到文本的一部分.我将文本添加到边框后旋转文本,这是导致问题的原因.增加边框的宽度可以解决此问题.但是,我的边界只需要20个单位.

alt text http://img257.imageshack.us/img257/1702/textcrop.jpg

我在这里失踪了什么?

        <Border
          Name="BranchBorder"
          CornerRadius="0"
          HorizontalAlignment="Left"
          Width="20">
          <TextBlock 
            Name="Branch" 
            FontSize="14"
            FontWeight="Bold"
            VerticalAlignment="Center">
           <TextBlock.RenderTransform>
             <RotateTransform 
               Angle="-90"/>
           </TextBlock.RenderTransform>
            Branch
          </TextBlock>
        </Border>
Run Code Online (Sandbox Code Playgroud)

ben*_*wey 7

尝试使用LayoutTransform

    <Border
      Name="BranchBorder"
      CornerRadius="0"
      HorizontalAlignment="Left"
      Width="20">
      <TextBlock
         Name="Branch"
         FontSize="14"
        FontWeight="Bold"
        VerticalAlignment="Center">
       <TextBlock.LayoutTransform>
         <RotateTransform
            Angle="-90"/>
       </TextBlock.LayoutTransform>
        Branch
      </TextBlock>
    </Border>
Run Code Online (Sandbox Code Playgroud)

有大量的博客条目描述了RenderTransform和LayoutTransform之间的区别,这是Charles Petzold的一个很酷的视觉演示RenderTransformVersusLayoutTransform.xaml