ColorAnimation
.NET프로그래밍/Silverlight 3.0 2009. 12. 3. 16:06 |[MainPage.xaml]
<UserControl x:Class="RiaColorAnimation.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:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<!--[1] Storyboard-->
<Grid.Triggers>
<EventTrigger RoutedEvent="Grid.Loaded">
<BeginStoryboard>
<Storyboard>
<ColorAnimation
Storyboard.TargetName="rect"
Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)"
Duration="0.0:0:5.0"
From="Red"
To="Blue"
AutoReverse="True"
RepeatBehavior="Forever"
/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Grid.Triggers>
<!--[2] 사각형 -->
<StackPanel>
<Rectangle x:Name="rect" Width="100" Height="100" Fill="Red" Margin="10"
Stroke="Yellow" StrokeThickness="3" RadiusX="10" RadiusY="5" />
</StackPanel>
</Grid>
</UserControl>
'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글
키프레임 (KeyFrame) - ColorAnimationUsingKeyFrames (0) | 2009.12.04 |
---|---|
여러개의 타임라인 사용하기 (0) | 2009.12.03 |
PointAnimation (0) | 2009.12.03 |
EventTrigger가 아닌 리소스를 사용 (0) | 2009.12.03 |
<DoubleAnimation /> - 이미지에 Animation 효과 주기(FadeIn) (0) | 2009.12.03 |