■ PointAnimationUsingKeyFrames 엘리먼트 사용하기

----------------------------------------------------------------------------------------------------

<Canvas

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Rectangle

        Width="480"

        Height="480"

        Stroke="Black" />

    <Path

        Fill="Aqua"

        Stroke="Chocolate"

        StrokeThickness="3">

        <Path.Data>

            <EllipseGeometry x:Name="ellipseGeometry"

                Center="240 50"

                RadiusX="48"

                RadiusY="48" />

        </Path.Data>

    </Path>

    <Canvas.Triggers>

        <EventTrigger RoutedEvent="Canvas.Loaded">

            <BeginStoryboard>

                <Storyboard

                    TargetName="ellipseGeometry"

                    TargetProperty="Center">

                    <PointAnimationUsingKeyFrames

                        RepeatBehavior="Forever"

                        Duration="0:0:4">

                        <LinearPointKeyFrame KeyTime="0:0:1" Value="430 240" />

                        <LinearPointKeyFrame KeyTime="0:0:2" Value="240 430" />

                        <LinearPointKeyFrame KeyTime="0:0:3" Value="50 240" />

                        <LinearPointKeyFrame KeyTime="0:0:4" Value="240 50" />

                    </PointAnimationUsingKeyFrames>

                </Storyboard>

            </BeginStoryboard>

        </EventTrigger>

    </Canvas.Triggers>

</Canvas>

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker