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

■ DoubleAnimation 엘리먼트를 사용해 펄스 애니메이션을 만드는 방법을 보여준다.

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="DoubleAnimation 엘리먼트 : 펄스 애니메이션 만들기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Ellipse
        HorizontalAlignment="Center"
        VerticalAlignment="Center"
        Width="48"
        Height="{Binding RelativeSource={RelativeSource self}, Path=Width}"
        Fill="Red">
        <Ellipse.Triggers>
            <EventTrigger RoutedEvent="Ellipse.Loaded">
                <BeginStoryboard>
                    <Storyboard
                        TargetProperty="Width"
                        RepeatBehavior="Forever">
                        <DoubleAnimation
                            FillBehavior="Stop"
                            RepeatBehavior="2x"
                            BeginTime="0:0:1"
                            Duration="0:0:0.25"
                            From="48"
                            To="288" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </Ellipse.Triggers>
    </Ellipse>
</Window>
728x90
그리드형(광고전용)
Posted by icodebroker
,