translate animation - How to give the x y position to image control at runtime in windows phone 7? -


i have set canvas in background , adding image pieces child of background canvas, want move specific image control given x y position of background canvas have tried kind of code given below

bg_canvas.children[it].rendertransform = new translatetransform();

            translatetransform trans = bg_canvas.children[it].rendertransform translatetransform;             doubleanimation animation = new doubleanimation();              animation.to = 80;              storyboard.settarget(animation, trans);             storyboard.settargetproperty(animation, new propertypath(translatetransform.xproperty));              storyboard story = new storyboard();             story.children.add(animation);               story.begin(); 

it's working problem moving image control not placed @ correct x position of background canvas , it's been taking x position image placed, 0th x position starts image control placed on canvas need set x position of background canvas image control placed. how can correct problem please tell me solution if known.

instead of using translation, tell canvas place image:

canvas.settop(image, 80); canvas.setleft(image, 160); 

edit: allow animate elements, can read storyboard - when use it, in property animate, put "(canvas.left)" or "(canvas.top)" appropriately.

if using wp8, can modify code posted in series of posts work on windows phone (it coded windows 8). makes animating stuff (including on canvas) easy.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -