첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
------------------------------------------------------------------------------------------------------------------------------------------------------
728x90
728x170

■ DoubleAnimationUsingPath 엘리먼트를 사용해 문자열을 깜박이는 방법을 보여준다.

TestProject.zip
다운로드

▶ MainWindow.xaml

<Window x:Class="TestProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="800"
    Height="600"
    Title="DoubleAnimationUsingPath 엘리먼트 : 문자열 깜박이기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Grid>
        <TextBlock x:Name="textBlock"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            FontFamily="Arial Black"
            FontSize="144pt"
            Text="XAML">
            <TextBlock.Triggers>
                <EventTrigger RoutedEvent="TextBlock.Loaded">
                    <BeginStoryboard>
                        <Storyboard
                            TargetName="textBlock"
                            TargetProperty="Opacity"
                            RepeatBehavior="Forever">
                            <DoubleAnimationUsingPath
                                Duration="0:0:4"
                                Source="Y">
                                <DoubleAnimationUsingPath.PathGeometry>
                                    <PathGeometry>
                                        <PathGeometry.Figures>
                                            <PathFigure StartPoint="0 0">
                                                <LineSegment Point="0 1" />
                                                <LineSegment Point="2 1" />
                                                <LineSegment Point="2 0" />
                                            </PathFigure>
                                        </PathGeometry.Figures>
                                    </PathGeometry>
                                </DoubleAnimationUsingPath.PathGeometry>
                            </DoubleAnimationUsingPath>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </TextBlock.Triggers>
        </TextBlock>
    </Grid>
</Window>
728x90
그리드형(광고전용)
Posted by icodebroker
,