RepeatBehavior - RepeatBehavior는 애니메이션 반복 횟수를 지정하기 위하여 사용 |
RepeatBehavior.Xamls <UserControl x:Class="AnimationExample.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:DesignWidth="640" d:DesignHeight="480"> <Canvas x:Name="LayoutRoot"> <Canvas.Resources> <!--사각형을 이동 시키는 스토리 보드 --> <Storyboard x:Name="rectAnimation"> <!-- Y 좌표 이동 애니메이션 --> <DoubleAnimation RepeatBehavior="5x" Duration=" Storyboard.TargetName="rect" Storyboard.TargetProperty="(Canvas.Top)" From="0" To="100"/> <!-- X 좌표 이동 애니메이션 --> <DoubleAnimation RepeatBehavior="5x" Duration=" Storyboard.TargetName="rect" Storyboard.TargetProperty="(Canvas.Left)" From="0" To="100"/> <!-- RepeatBehavior를 설정 (속성지정) --> <!--<DoubleAnimation RepeatBehavior="2x" Duration="00:00:01" Storyboard.TargetName="rect" Storyboard.TargetProperty="(Canvas.Top)" From="0" To="100"/> <DoubleAnimation RepeatBehavior="2x" Duration="00:00:01" Storyboard.TargetName="rect" Storyboard.TargetProperty="(Canvas.Left)" From="0" To="100"/>--> </Storyboard> </Canvas.Resources> <!-- 사각형 --> <Rectangle x:Name="rect" Fill="Red" Width="100" Height="100" Canvas.Left="0" Canvas.Top="0"/> </Canvas> </UserControl> |
'.Net Project > SilverLight 3.0' 카테고리의 다른 글
65장 에니메이션 TimeLine (EasingFunction) (0) | 2009.12.07 |
---|---|
64장 에니메이션 TimeLine (DoubleAnimation) (0) | 2009.12.07 |
62장 에니메이션 TimeLine (SpeedRatio) (0) | 2009.12.07 |
61장 에니메이션 TimeLine (FillBehaviorExample) (0) | 2009.12.07 |
60장 에니메이션 TimeLine (DurationExample) (0) | 2009.12.07 |