<Window.Resources>
<Storyboard x:Key="AnimateTarget">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Transform"
Storyboard.TargetProperty="ScaleX">
<EasingDoubleKeyFrame KeyTime="0:0:0"
Value="0.0" />
<EasingDoubleKeyFrame KeyTime="0:0:3"
Value="2.0">
<EasingDoubleKeyFrame.EasingFunction>
<ElasticEase EasingMode="EaseOut"
Oscillations="13"
Springiness="8" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Transform"
Storyboard.TargetProperty="ScaleY">
<EasingDoubleKeyFrame KeyTime="0:0:0"
Value="0.0" />
<EasingDoubleKeyFrame KeyTime="0:0:0"
Value="2.0">
<EasingDoubleKeyFrame.EasingFunction>
<ElasticEase EasingMode="EaseOut"
Oscillations="13"
Springiness="8" />
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>
谢谢:)
我想创建一个方法..即时通讯卡住这个.. 私人无效BounceBounceBaby(字符串strControlName,的Int32 intSeconds) { 故事板animateTarget =新故事板(); TimeSpan keyValue = new TimeSpan(0,0,intSeconds); DoubleAnimationUsingKeyFrames dblAnimKey = new DoubleAnimationUsingKeyFrames(); Storyboard.SetTargetName(dblAnimKey,strControlName); Storyboard.SetTargetProperty(dblAnimKey,new PropertyPath(ScaleTransform.ScaleXProperty)); animateTarget.Children.Add(dblAnimKey); animateTarget.Begin(this); } – Rhizokeel 2011-05-18 10:57:37
您可以将其作为“更新”发布在答案中: – 2011-05-18 11:04:04