views:

361

answers:

1

I would like to perform a rectangual hit test on WPF Canvas component in order to get Controls that are overlapped by a Rectangle framework element. I found a Silverlight's VisualTreeHelper.FindElementsInHostCoordinates method, but apparently it's not available in WPF. What's the best method to achieve such functionality?

+2  A: 

The closest equivalent is VisualTreeHelper.HitTest. It works significantly differently to Silverlight's FindElementsInHostCoordinates, but you should be able to use it for your needs.

KeithMahoney