Q:

Storyboard.Gettarget returned result is Null

DoubleAnimation da = new DoubleAnimation();
da.From = 0;
da.To = 400;
da.Duration = new Duration(TimeSpan.FromSeconds(1));
Storyboard.SetTargetName(da, "r13");
Storyboard.SetTargetProperty(da, new PropertyPath(Canvas.LeftProperty));
mySubStoryBoard.Children.Add(da);
DependencyObject do =Storyboard.GetTarget(mySubStoryBoard.Children[0]);
string str = Storyboard.GetTargetName(mySubStoryBoard.Children[0]);

result : do==null,str==r13.
Why is that?Help me,thanks.

A:

What do you expect? You set Storyboard.SetTargetName Method and Storyboard.SetTargetProperty Method but not Storyboard.SetTarget Method.
That's why Storyboard.GetTarget Method returns null.

