MainPage.xaml |
[그림 76-1] <Canvas x:Name="LayoutRoot" Background="White"> <Canvas.Resources> <Storyboard x:Name="sb"> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="myRect" Storyboard.TargetProperty="(Canvas.Top)" Duration="00:00:10"> <!--여러가지 모양을 단어화--> <EasingDoubleKeyFrame Value="400" KeyTime="00:00:10"> <EasingDoubleKeyFrame.EasingFunction> <!--<SineEase></SineEase>-->
<!--그래프의 속도로 떨어짐--> <!--<ElasticEase></ElasticEase>-->
<!--찰랑거리는 모양--> <BounceEase></BounceEase> <!--공 튀기는 모양--> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> </DoubleAnimationUsingKeyFrames> </Storyboard> </Canvas.Resources> <Rectangle x:Name="myRect" Width="50" Height="50" Fill="DodgerBlue"></Rectangle> </Canvas> |
MainPage.xaml.cs |
namespace EasingKeyFrame { public partial class MainPage : UserControl { public
MainPage() { InitializeComponent(); myRect.MouseLeftButtonDown += new MouseButtonEventHandler(myRect_MouseLeftButtonDown); } void
myRect_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { sb.Begin(); } } } |
결과화면 |
[그림 76-2] |
'Silverlight' 카테고리의 다른 글
78.SilverLight3 - TargetedTriggerAction 그룹 : ChangedPropertyAction (0) | 2009.12.07 |
---|---|
77.SilverLight3 - Trigger [개발자] (0) | 2009.12.07 |
75.SilverLight3 - SplineKeyFrame (0) | 2009.12.04 |
74.SilverLight3 - DiscreteKeyFrame (0) | 2009.12.04 |
73.SilverLight3 - LinearKeyFrame (0) | 2009.12.04 |
Comments