SetTargetProperty for a Canvas
-
If I am not using StoryBoard I cam use my canvas to animate with a simple function DoubleAnimation growAnimation = new DoubleAnimation(600, 0, TimeSpan.FromSeconds(1)); myCanvas.RenderTransform.BeginAnimation(ScaleTransform.ScaleXProperty, growAnimation); // Line 1 It works fine. Now I would like to add to the StoryBoard. Storyboard.SetTarget(growAnimation, myCanvas); Storyboard.SetTargetProperty(growAnimation, new PropertyPath(Canvas.WidthProperty)); It works up to seme extend, but I am not changing the width. I am looking the to set the property like Line 1 Obviously it works if I declare in xaml file like Storyboard.TargetProperty="(Canvas.RenderTransform).(ScaleTransform.ScaleX)" In other words what is equal of above lint in code behind? Storyboard.SetTargetProperty(growAnimation, new PropertyPath(What should be here)); Any help will be very much appreciated. best regards Agha Khan