You can detect your image position in a WebBrowser control via JavaScript:
function fetchImagePosition()
{
var rect = document.getElementByIdimageId").getBoundingClientRect();
window.external.Notify(rect.left + ',' + rect.top + ',' + rect.right + ',' + rect.bottom);
}
Also add above script execution on your HTML is loaded:
window.onload = function ()
{
var elem = document.getElementById('content');
window.external.Notify(elem.scrollHeight + ''); fetchLinkPosition();}
Enable your WebBrowser to execute JavaScript IsScriptEnabled=true. Add a handler to WebBrowser ScriptNotify event to catch the image position and save it to a local field:
private void BrowserScriptNotify(object sender, NotifyEventArgs e)
{
var rectBoundaries = e.Value.Split(',').Select(double.Parse).ToArray();
var rectHeight = rectBoundaries[3] - rectBoundaries[1];
var rectWidth = rectBoundaries[2] - rectBoundaries[0];
_imageRect= new Rect(rectBoundaries[0], rectBoundaries[1], rectWidth, rectHeight);
}
Add Tap event handler to your LayoutRoot:
private void LayoutRootTap(object sender, System.Windows.Input.GestureEventArgs e)
{
var point = e.GetPosition(Browser);
if (_imageRect.Contains(point))
{
NavigationService.Navigate("YourPageUri");
}
}