what is the use of X:Uid attribute in silverlight controls
Share
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.
As a practical example, we have used x:Uid for UI automation purposes.
Tools like UISpy see what you stuff in the value of the x:Uid attribute … as the AutomationID property. See this MSDN article for more info. In other words, it identifies the controls that you wish to automate/test and allows you to actually do that automation/testing.
In fact, the above is the only reason we have ever used this attribute.
Now, in my case, I am talking about the WPF applications I’ve worked on, and I can see from your question that you are asking about the Silverlight controls. Maybe Silverlight doesn’t (yet) have a way to automate/test the controls in the same manner … in that case, Austin Lamb’s answer makes a lot of sense. Many things are done in Silverlight that don’t have any apparent purpose … other than for compatibility reasons (so you have less work to do when making controls that work on both platforms).