2009-06-11 6 views
1

J'essaye d'animer la ligne qui traverse le texte dans un bloc de texte. Voici ce que j'ai jusqu'ici.Comment animer TextDecoration Strikethrougn sur un TextBlock?

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 
<Page.Resources> 
    <Style x:Key="TextBlockEliminated"> 
     <Setter Property="Control.FontSize" Value="18"/> 
     <Setter Property="Control.FontWeight" Value="Bold"/> 
     <Setter Property="Control.Foreground" Value="Gray"/> 
     <Setter Property="TextBlock.TextDecorations"> 
      <Setter.Value> 
       <TextDecorationCollection> 
        <TextDecoration x:Name="animatedStrikeThrough" Location="Strikethrough"/> 
       </TextDecorationCollection> 
      </Setter.Value> 
     </Setter> 
    </Style> 
</Page.Resources> 
<Grid> 
    <TextBlock Style="{StaticResource TextBlockEliminated}">Some Text 
    </TextBlock> 
</Grid> 


Avis Je n'Appy pas DoubleAnimation des thats nulle part parce que je ne peux pas comprendre comment l'appliquer à la TextDecoration PinOffset.

Répondre

1

Avoir deux TextBlocks empilés les uns sur les autres, l'un avec du texte normal, et l'autre avec le retrait barré, mais son opacité réglée à zéro. Puis, fondez l'opacité dans et hors de votre animation.

Questions connexes