3
votes

I am getting error :

WinRT information: Cannot resolve TargetProperty Canvas.Left on specified object.

Getting this error on run ( build is ok ). Important part of the code:

var canvasAnim = new DoubleAnimation() { To = -50, Duration = new Duration(TimeSpan.FromSeconds(0.3)) };
Storyboard.SetTarget(canvasAnim, MyWipedText);
Storyboard.SetTargetProperty(canvasAnim, "Canvas.Left");

I am attaching animation in code behind because this is done after a general swipe on a bigger control. Any idea how to get this property to work ? ( Opacity works fine here btw ).

Thanks

1

1 Answers

6
votes

You need to do "(Canvas.Left)" as in

Storyboard.SetTargetProperty(canvasAnim, "(Canvas.Left)");

Note that it does not work for custom (user defined) attached dependency properties.