첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
유용한 소스 코드가 있으면 icodebroker@naver.com으로 보내주시면 감사합니다.
블로그 자료는 자유롭게 사용하세요.

728x90
반응형

TestProject.zip
다운로드

▶ MainWindow.xaml

<Window x:Class="TestProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="800"
    Height="600"
    Title="ColorAnimationUsingKeyFrames 엘리먼트 사용하기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Canvas
        Margin="100"
        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>
</Window>
728x90
반응형
Posted by 사용자 icodebroker

댓글을 달아 주세요