Blog Content

    티스토리 뷰

    70.SilverLight3 - PointAnimation

    반응형
    PointAnimation
    - 위치를 변경하는 애니메이션

    MainPage.xaml

    [그림 70-1]


    <Canvas Background="White" Width="400" Height="300">

        <!--[1] -->

        <Canvas.Triggers>

            <EventTrigger RoutedEvent="Canvas.Loaded">

                <BeginStoryboard>

                    <Storyboard>

                        <PointAnimation

                            Storyboard.TargetName="myLine"

                            Storyboard.TargetProperty="EndPoint"

                            Duration="0.0:0:2.0"

                            From="100,100"

                            To="50,100"

                            AutoReverse="True"

                            RepeatBehavior="2x"></PointAnimation>

                    </Storyboard>

                </BeginStoryboard>

            </EventTrigger>

        </Canvas.Triggers>

        <!--[2] -->

        <Path Fill="Black" Stroke="Silver" StrokeThickness="3">

            <Path.Data>

                <LineGeometry x:Name="myLine" StartPoint="50,50" EndPoint="100,100">

                </LineGeometry>

            </Path.Data>

        </Path>

    </Canvas>


    결과화면

    [그림 70-2]



    반응형

    'Silverlight' 카테고리의 다른 글

    72.SilverLight3 - TimeLine  (0) 2009.12.03
    71.SilverLight3 - ColorAnimation  (0) 2009.12.03
    69.SilverLight3 - DoubleAnimation  (0) 2009.12.03
    68.SilverLight3 - Template  (0) 2009.12.03
    67.SilverLight3 - Style  (0) 2009.12.03

    Comments