■ ParallelTimeline 엘리먼트 사용하기

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

<Window

    x:Class="TestProject.MainWindow"

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

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

    Width="600"

    Height="450"

    Title="ParallelTimeline 엘리먼트 사용하기">

    <Canvas>

        <Ellipse

            Canvas.Left="0"

            Canvas.Top="0"

            Width="48"

            Height="48"

            Fill="Red">

            <Ellipse.Triggers>

                <EventTrigger RoutedEvent="Ellipse.MouseDown">

                    <BeginStoryboard>

                        <Storyboard>

                            <DoubleAnimation

                                Storyboard.TargetProperty="(Canvas.Left)"

                                AutoReverse="True"

                                RepeatBehavior="20x"

                                Duration="0:0:0.25"

                                From="0"

                                To="288" />

                            <DoubleAnimation

                                Storyboard.TargetProperty="(Canvas.Top)"

                                AutoReverse="True"

                                Duration="0:0:5"

                                From="0"

                                To="480" />

                            <ParallelTimeline

                                BeginTime="0:0:10"

                                FillBehavior="Stop">

                                <DoubleAnimation

                                    Storyboard.TargetProperty="Width"

                                    Duration="0:0:1"

                                    From="48"

                                    To="480" />

                                <DoubleAnimation

                                    Storyboard.TargetProperty="Height"

                                    Duration="0:0:1"

                                    From="48"

                                    To="480" />

                            </ParallelTimeline>

                        </Storyboard>

                    </BeginStoryboard>

                </EventTrigger>

            </Ellipse.Triggers>

        </Ellipse>

    </Canvas>

</Window>

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

Posted by 사용자 icodebroker