1

テキストブロック内のテキストを打ち破る線をアニメーション化しようとしています。これが私がこれまでに持っているものです。

<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 に適用する方法がわからないため、どこにも DoubleAnimation を適用しないことに注意してください。

4

1 に答える 1

1

2 つの TextBlocks を重ね合わせます。1 つは通常のテキスト、もう 1 つは取り消し線が適用されていますが、不透明度はゼロに設定されています。次に、アニメーションの不透明度をフェードインおよびフェードアウトします。

于 2009-06-11T22:31:46.860 に答える