How do you find the screen position of a control in silverlight on WP7?
Any suggestions are much appreciated.
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.
If you know how it’s positioned (eg in a
Canvas) there may be a more appropriate way to do things, but in general, you can useUIElement.TransformToVisualto convert between the control’s and the global coordinate system:Be sure that the control has undergone layout before trying to do this, if you do it too early the error messages are generally unhelpful.
(MSDN suggests the method is present in WP7, I don’t have the SDK installed to test)