첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
------------------------------------------------------------------------------------------------------------------------------------------------------
728x90
728x170

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="DiscreteDoubleKeyFrame 엘리먼트 : 초침을 끊어서 움직이기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Canvas
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
        <Line Canvas.Left="150" Canvas.Top="150"
            Stroke="Black"
            StrokeThickness="3"
            X1="0"
            Y1="0"
            X2="0"
            Y2="-100">
            <Line.RenderTransform>
                <RotateTransform x:Name="rotateTransform1" />
            </Line.RenderTransform>
        </Line>
        <Line Canvas.Left="450" Canvas.Top="150"
            Stroke="Black"
            StrokeThickness="3"
            X1="0"
            Y1="0"
            X2="0"
            Y2="-100">
            <Line.RenderTransform>
                <RotateTransform x:Name="rotateTransform2" />
            </Line.RenderTransform>
        </Line>
        <Canvas.Triggers>
            <EventTrigger RoutedEvent="Canvas.Loaded">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation
                            Storyboard.TargetName="rotateTransform1"
                            Storyboard.TargetProperty="Angle"
                            From="0"
                            To="360"
                            Duration="00:01:00"
                            RepeatBehavior="Forever" />
                        <DoubleAnimationUsingKeyFrames
                            Storyboard.TargetName="rotateTransform2"
                            Storyboard.TargetProperty="Angle"
                            RepeatBehavior="Forever"
                            IsCumulative="True">
                            <DiscreteDoubleKeyFrame KeyTime="00:00:01" Value="6" />
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </Canvas.Triggers>
    </Canvas>
</Window>
728x90
그리드형(광고전용)
Posted by icodebroker
,