Skip to main content

Microsoft Silverlight

Answered Question FindElementsInHostCoordinates returns all inner controlsRSS Feed

(0)

tlucz
tlucz

Member

Member

0 points

4 Posts

FindElementsInHostCoordinates returns all inner controls

 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 Tang - MSFT
Min-Hong...

Contributor

Contributor

3375 points

377 Posts

Answered Question

Re: FindElementsInHostCoordinates returns all inner controls

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. 

 

Min-Hong Tang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities