If a have a Canvas parent, it is very easy to get the position of a child:
Canvas.GetLeft/Top (child)
But how can I get the position of a child for other types of parents?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It can be done using
TranslatePointmethod of the control.new Point(0, 0)represents the top left point of the control andTranslatePointwill return the location of that point relative to the parent control (I assumed here the parent is aUIElement).You can place instead of container any ancestor of the control.