日期:2014-05-17 浏览次数:20812 次
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="image4"> <EasingDoubleKeyFrame KeyTime="0:0:1" Value="30"> <EasingDoubleKeyFrame.EasingFunction> <CircleEase EasingMode="EaseInOut"/> </EasingDoubleKeyFrame.EasingFunction> </EasingDoubleKeyFrame> </DoubleAnimationUsingKeyFrames>
DoubleAnimation daRotation = new DoubleAnimation(); daRotation.From = rd.Next(360); daRotation.To = rd.Next(360); daRotation.EasingFunction = new CircleEase() { EasingMode = EasingMode.EaseInOut }; daRotation.Duration = new TimeSpan(0, 0, 0, 0, 1500); Storyboard.SetTargetProperty(daRotation, new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)")); Storyboard.SetTarget(daRotation, element); sb.Children.Add(daRotation);