2013-12-17 52 views
0

我有文本塊這樣WPF,TextBlock的與RotateTransform和一個LinearGradientBrush

<TextBlock Text="BETA" 
      FontSize="28" 
      HorizontalAlignment="Right" 
      VerticalAlignment="Center" 
      Margin="0,17,420,271" 
      FontFamily="Georgia"> 
    <TextBlock.RenderTransform> 
     <RotateTransform Angle="20" /> 
    </TextBlock.RenderTransform> 
    <TextBlock.Foreground> 
     <LinearGradientBrush StartPoint="0,0" 
           EndPoint="0,24" 
           MappingMode="Absolute"> 
      <GradientStopCollection> 
       <GradientStop Color="White" 
           Offset="0" /> 
       <GradientStop Color="Orange" 
           Offset=".2" /> 
       <GradientStop Color="DarkOrange" 
           Offset=".85" /> 
       <GradientStop Color="White" 
           Offset="1" /> 
      </GradientStopCollection> 
     </LinearGradientBrush> 
    </TextBlock.Foreground> 
</TextBlock> 

它不會提供任何文本。如果我刪除變換或刷,那麼它工作正常,但兩者都不會呈現任何東西。

+0

它適合我。 – Johnbot

+0

在運行時適合我,在設計時沒有看到任何東西,您是否真的嘗試過調試? – JMK

+0

我在VS2010中有設計時問題,VS2012在設計時工作。 –

回答

0

刪除絕對作爲映射模式解決了我的問題?不知道爲什麼。