728x90
728x170
■ DoubleAnimation 엘리먼트를 사용해 진자 운동의 애니메이션을 만드는 방법을 보여준다.
▶ 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="DoubleAnimation 엘리먼트 : 진자 운동 애니메이션 만들기"
FontFamily="나눔고딕코딩"
FontSize="16">
<StackPanel Width="200">
<Line
X1="100"
Y1="0"
X2="100"
Y2="200"
StrokeThickness="3"
Stroke="Black" />
<Ellipse
HorizontalAlignment="Center"
Width="50"
Height="50"
Stroke="Black"
StrokeThickness="3"
Fill="Green" />
<StackPanel.RenderTransform>
<RotateTransform x:Name="RotateTransformKey"
CenterX="100"
CenterY="0" />
</StackPanel.RenderTransform>
<StackPanel.Triggers>
<EventTrigger RoutedEvent="StackPanel.Loaded">
<BeginStoryboard>
<Storyboard
TargetName="RotateTransformKey"
TargetProperty="Angle">
<DoubleAnimation
RepeatBehavior="Forever"
AutoReverse="True"
AccelerationRatio="0.5"
DecelerationRatio="0.5"
Duration="0:0:1"
From="-30"
To="30" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</StackPanel.Triggers>
</StackPanel>
</Window>
728x90
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] DynamicResource 엘리먼트 : 리소스 사용하기 (0) | 2015.10.10 |
---|---|
[C#/WPF] ColorAnimationUsingKeyFrames 엘리먼트 사용하기 (0) | 2015.10.08 |
[C#/WPF] StringAnimationUsingKeyFrames 엘리먼트 : 문자열 교대로 표시하기 (0) | 2015.10.08 |
[C#/WPF] DoubleAnimationUsingKeyFrames 엘리먼트 : 문자열 교대로 표시하기 (0) | 2015.10.08 |
[C#/WPF] PointAnimationUsingKeyFrames 엘리먼트 : 공 튕기기 (0) | 2015.10.08 |
[C#/WPF] Binding 태그 확장 : RelativeSource 속성에서 RelativeSource 태그 확장을 사용해 상위 엘리먼트 속성 바인딩하기 (0) | 2015.10.07 |
[C#/WPF] Thumb 클래스 : 크기 조절 그립 사용하기 (0) | 2015.10.06 |
[C#/WPF] TextBox 클래스 : TextInput 이벤트 사용하기 (0) | 2015.10.02 |
[C#/WPF] TextBox 엘리먼트 : 한글 입력 모드 설정하기 (0) | 2015.10.02 |
[C#/WPF] PolyBezierSegment 엘리먼트 : 무지개 색 무한대 기호 만들기 (0) | 2015.10.01 |