Skip to main content
Home Forums General Silverlight Getting Started FindElementsInHostCoordinates returns all inner controls
1 replies. Latest Post by Min-Hong Tang - MSFT on November 4, 2009.
(0)
tlucz
Member
0 points
4 Posts
10-31-2009 3:59 AM |
When I use FindElementsInHostCoordinate and point on e.g Button it returns on first places inner Buttons objects like: Rectangle, Border...
Is it easy way to get on first place only main (first level, direct child) control?
TL
Min-Hong...
Contributor
3375 points
377 Posts
11-04-2009 4:01 AM |
Hi,
I am afraid , this is by desin. The method just function like this.
To archieve what you need i believe you need to use another methods.
For example you want to get the first direct child of a button(a grid), you can use code block below:
VisualTreeHelper.GetChild(YourButtonName,0)
The second is a index , it determines whick child to get.
Best Regards.