我正在尝试为文本块中的文本设置动画。这是我到目前为止所拥有的。
<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>
请注意,我不会在任何地方应用 DoubleAnimation,因为我不知道如何将它应用到 TextDecoration PinOffset。