- Timeline 클래스 (애니메이션의 부모 클래스)
- Storyboard 클래스 (애니메이션 실행 역할)





[MainPage.xaml]


<UserControl x:Class="RiaAnimation.MainPage"

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

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

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="300" d:DesignWidth="400">

 

    <Grid x:Name="LayoutRoot" Background="White">

        <Rectangle x:Name="rect" Fill="Yellow" Stroke="Red" StrokeThickness="2" Width="100" Height="100">

            <Rectangle.Triggers>

                <EventTrigger RoutedEvent="Rectangle.Loaded">

                    <BeginStoryboard>

                        <Storyboard>

                            <DoubleAnimation

                                Storyboard.TargetName="rect"

                                Storyboard.TargetProperty="Opacity"

                                Duration="0:0:5.0"

                                From="0.1"

                                To="1.0"

                            />

                        </Storyboard>

                    </BeginStoryboard>

                </EventTrigger>

            </Rectangle.Triggers>

        </Rectangle>

    </Grid>

</UserControl>

 

 

























Posted by holland14
: