In my application I am using a canvas which is dynamically generated at runtime. I am placing a textblock on the canvas but it is showing at top left corner of the canvas. How can I change its position. I have search and everyone is showing myCanvas.SetLeft(myTextBlock,10); but I could not find this command in the dropdown list.
Is there any other method to achieve this?
Try just
Canvas.SetLeft(myTextBlock,10);This will add your textblock to the children collection of myCanvas and then the
Canvasclass can allow myCanvas to control the left properties of all its children.This is an example of an attached property.