Search code examples
c#silverlightwindows-phone-7silverlight-toolkit

Touch position in WP7


I have a WebBrowser in my application, I need to know where the position of primary touch is in the screen.

this event not fired in the WebBrowser:

Touch.FrameReported += new TouchFrameEventHandler(Touch_FrameReported);

and also this:

GestureService.GetGestureListener(webBrowser1);

How I can do this?


Solution

  • You can add JavaScript function to your page that will call window.external.notify to send touch position from WebBrowser to your C# code. You will need to subscribe to WebBrowser.ScriptNotify event and allow JavaScript execution in WebBrowser.