Search code examples
silverlightabsolute-value

How do you programatically position an object in Silverlight?


In Flash this question is answered really easy because you can set the X and Y coordinates of an object:

newxpos = object._x;
newypos = object._y;

How do you do the same in Silverlight?


Solution

  • Place the object inside a canvas element and then use:

    Canvas.SetLeft(object, value);
    Canvas.SetTop(object, value);