c# - Cannot resolve TargetProperty when using StoryBoard in WinRT -
i trying set storyboard in code behind, exception thrown every time saying
"cannot resolve targetproperty (uielement.rendertransform).(compositetransform.scalex) on specified object."
here code:
image img = new image() { source = image.source, name="image"+i.tostring()}; var pointedstoryboard = new storyboard(); var doubleannimationx = new doubleanimation(); doubleannimationx.duration = timespan.frommilliseconds(500); doubleannimationx.to = 2; pointedstoryboard.children.add(doubleannimationx); storyboard.settarget(doubleannimationx, img); storyboard.settargetproperty(doubleannimationx, "(uielement.rendertransform).(compositetransform.scalex)");
i tried
storyboard.settargetname(doubleannimationx, "image" + i.tostring());
instead of
storyboard.settarget(doubleannimationx, img);
but did work , don't know , thankful if me ! in advance .
you need add composite transform image first.
img.rendertransform = new compositetransform();
then should able reference it.
Comments
Post a Comment