Page 1 of 1

Accessing Icon info of a Picture from Silverlight

Posted: Mon Feb 06, 2012 5:57 pm
by Aracknid
When I use Spy on a picture from Silverlight, Spy shows In General --> Role (picture) --> Icon

How do I access the info of this icon section. Specifically I'm looking at the Tag property.

If you provide code, VB please. :D

Thanks,

Aracknid

Re: Accessing Icon info of a Picture from Silverlight

Posted: Tue Feb 07, 2012 7:16 am
by Support Team
Hi,

the following code provides the attributes and the attribute values for a picture element.

Code: Select all

Dim pictureImage = repo.WebDocumentSilverlight_Toolkit_Samp.PictureImage
			For Each attribute As AttributeDescriptor In pictureImage.Element.Attributes
				Report.Info(Convert.ToString(attribute) & ": " & vbTab & Convert.ToString(pictureImage.Element.GetAttributeValue(attribute.ToString())) & vbLf)
			Next
If you are writing Tag property, what exactly do you mean with tag property.

Regards,
Martin
Ranorex Support Team

Re: Accessing Icon info of a Picture from Silverlight

Posted: Tue Feb 07, 2012 3:53 pm
by Aracknid
The reason I was hoping to get the Tag was because we are trying to figure out a way to pass the source file through Silverlight to Ranorex so I know what picture is what. You suggested we look into UIAutomation in another post (http://www.ranorex.com/forum/possible-t ... t2288.html), but that was not something warmly excepted by the development team.

This lead them to be willing to try other things... I was asked if I could read the Image Tag property, and I said maybe... There's a Tag property for icon visible in Spy tool...What ever they did on the dev side didn't seem to work, since I still saw nothing. Then they tried something called HelpText, and it showed up in Spy in the UIAutomation section... See picture, and scroll to bottom.
spy bmp.JPG
So now I need to figure out how to read the HelpText property of the Picture element's UIAutomation section. I managed to do it, but it seemed to be a lot of code and I had to add a bunch of references. Is there an easy way?

Aracknid

Re: Accessing Icon info of a Picture from Silverlight

Posted: Tue Feb 07, 2012 7:46 pm
by Aracknid
Please ignore my previous post above. I was not properly informed by the developer working on this. It turns out that he did use the UIAutomation class and he did stuff the HelpText property with the file name as per your suggestions in the other post.

Also, I figured out the easy way to read the UIAutomation values from the Ranorex element.

Aracknid.