wpf - Set TargetName dynamically and DoubleAnimationUsingKeyFrames in XAML -


I want to know how to change the goal name dynamically with the same animation

Please enter your code below Find XML and C # code for WPF

XML code

  & lt; Storyboard X: Key = "Deepan Singh" & gt; & Lt; Double AnimationUsingFrame x: Name = "Gupta" Storyboard Targetproperty = "(UIElement.RenderTransform). (TransformGroup.Children) [0]. (ScaleTransform.ScaleX)" Storyboard.TargetName = "image1" & gt; & Lt; EasingDoubleKeyFrame keytime = "0: 0: 0.3" value = "0.641" /> & Lt; EasingDoubleKeyFrame keytime = "0: 0: 0.5" value = "1" /> & Lt; / DoubleAnimationUsingKeyFrames & gt; & Lt; Double animation tool's frame storyboard. TargetProperty = "(UIElement.RenderTransform). (TransformGroup.Children) [0]. (ScaleTransform.ScaleY)" Storyboard.TargetName = "image1" & gt; & Lt; EasingDoubleKeyFrame KeyTime = "0: 0: 0.3" value = "0.689" /> & Lt; EasingDoubleKeyFrame keytime = "0: 0: 0.5" value = "1" /> & Lt; / DoubleAnimationUsingKeyFrames & gt; & Lt; Double AnimationCofFrame Storyboard Treascapeproperty = "(UIElement.RenderTransform). (TransformGroup.Children) [3]. (Translation TRansform.X)" Storyboard.TargetName = "image1" & gt; & Lt; EasingDoubleKeyFrame keytime = "0: 0: 0.3" value = "- 1" /> & Lt; EasingDoubleKeyFrame KeyTime = "0: 0: 0.5" value = "0" /> & Lt; / DoubleAnimationUsingKeyFrames & gt; & Lt; Double animation tool's frame storyboard. TargetProperty = "(UIElement.RenderTransform). (TransformGroup.Children) [3]. (Translation TRANSFORM.Y)" Storyboard. Target = "image1" & gt; & Lt; Time of EasingDoubleKeyFrame = "0: 0: 0.3" value = "0.5" /> & Lt; EasingDoubleKeyFrame KeyTime = "0: 0: 0.5" value = "0" /> & Lt; / DoubleAnimationUsingKeyFrames & gt; & Lt; / Storyboard & gt;   

C #

  Storyboard SB = (Storyboard) FindResource ("Dinesh");   

How to change storyboaname from image1 to image2?

Thank you Regards, Deepanshu

  storyboard sb = (storyboard) FindResource ("Dinesh"); Foreign Hair (Miscellaneous Animation in SB Hair) {Storyboard. Set Turgnem (animation, "Image 2"); }    

Comments