Click here to Skip to main content
15,999,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i give this Animation for a Dynamic Frame



void DoAnimation(DependencyObject obj)
       {
           var sb = new Storyboard();

           var da1 = new DoubleAnimationUsingKeyFrames();
           da1.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(0)), Value = 1 });
           da1.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(15)), Value = 0, KeySpline = new KeySpline(0,0,0.4,0.969) });
           Storyboard.SetTargetProperty(obj, new PropertyPath("(UIElement.Opacity)"));
           Storyboard.SetTarget(da1, obj);
           sb.Children.Add(da1);

           var da3 = new DoubleAnimationUsingKeyFrames();
           da3.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(0)), Value = 1 });
           da3.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(15)), Value = 0.8, KeySpline = new KeySpline(0, 0, 0.4, 0.969) });
           da3.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(15)), Value = 1 });
           da3.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(25)), Value = 1 });
           Storyboard.SetTargetProperty(da3, new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"));
           Storyboard.SetTarget(da3, obj);
           sb.Children.Add(da3);

           var da5 = new DoubleAnimationUsingKeyFrames();
           Storyboard.SetTargetProperty(da5, new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"));
           Storyboard.SetTarget(da5, obj);
           da3.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(0)), Value = 1 });
           da3.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(15)), Value = 0.8, KeySpline = new KeySpline(0, 0, 0.4, 0.969) });
           da3.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(15)), Value = 1 });
           da3.KeyFrames.Add(new SplineDoubleKeyFrame { KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(25)), Value = 1 });
           sb.Children.Add(da5);

           sb.Begin();
       }

I am creating a dynamic Frame . How can i give this animation for a dynamic frame .

Please help me
Posted
Updated 5-Feb-12 23:52pm
v2

1 solution

By setting the target. What does 'dynamic frame' mean ? How is it different ?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900