I have a bunch of images I'm using for a chess game in a canvas using wpf, xaml, and C#. I want to use
Canvas.SetTop(image, position);
to set the position of this image. However I am given the index of child in my canvas and that is it.
myCanvas.children[index]
I tried
Canvas.SetTop(myCanvas.children[index], position);
but that did not work. How can I change the position of the image given only the index of the image in the canvas?
Edit: Another option would be to change the position of the canvas child. But I couldn't find anything for that.