■ ColorAnimationUsingKeyFrames 엘리먼트 사용하기

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

<Canvas

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

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

    Background="Red">

    <Canvas.Triggers>

        <EventTrigger RoutedEvent="Canvas.Loaded">

            <BeginStoryboard>

                <Storyboard TargetProperty="Background.Color">

                    <ColorAnimationUsingKeyFrames RepeatBehavior="Forever">

                        <LinearColorKeyFrame KeyTime="0:0:0" Value="Red"    />

                        <LinearColorKeyFrame KeyTime="0:0:1" Value="Orange" />

                        <LinearColorKeyFrame KeyTime="0:0:2" Value="Yellow" />

                        <LinearColorKeyFrame KeyTime="0:0:3" Value="Green" />

                        <LinearColorKeyFrame KeyTime="0:0:4" Value="Blue"   />

                        <LinearColorKeyFrame KeyTime="0:0:5" Value="Indigo" />

                        <LinearColorKeyFrame KeyTime="0:0:6" Value="Violet" />

                        <LinearColorKeyFrame KeyTime="0:0:7" Value="Red"    />

                    </ColorAnimationUsingKeyFrames>

                </Storyboard>

            </BeginStoryboard>

        </EventTrigger>

    </Canvas.Triggers>

</Canvas>

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

Posted by 사용자 icodebroker