Unfortunately, HitTestResult
etc. are not available on Windows Phone (there is a documentation bug that incorrectly associates all of .NET 4.5 with Windows Phone). You can use VisualTreeHelper
to get at what you want though. You can handle a Tap
event then use the coordinates to tell what control was tapped. For example:
private void OnTap(object sender, GestureEventArgs e)
{
var element = (UIElement)sender;
var controls = VisualTreeHelper.FindElementsInHostCoordinates(e.GetPosition(element), element);
// TODO: something with controls, like search for type Button, etc.
}