locked
windows phone 8.1 how to capture events of zooming in or out?

    Question

  • Hi, I am trying to capture events such as zoom in or zoom out in WebView element, but I found nowhere to find such event in this control, any idea?

    Many thanks!

    Have a great Thanksgiving Day


    Never Give Up!


    Friday, November 28, 2014 8:26 AM

Answers

  • Hi Chunde Huang,

    I don't think you can do this, basically when you have HTML page hosted in WebView, your app manipulation will be handled by HTML page instead of WebView. For instance if you click some button on HTML page, WebView will not fire a Tapped or Click event.

    To capture the zoom in/out (pinch) event, the easiest way is to handle it by JavaScript and use ScriptNotify event to pass the event out.

    --James


    <font color="0099FF"><THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED></font><br/> Thanks<br/> MSDN Community Support<br/> <br/> Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, November 28, 2014 3:31 PM
    Moderator
  • Hi,

    Please give a try with this. I guess, it will work Windows Phone as well.

    http://blogs.msdn.com/b/wsdevsol/archive/2013/05/28/webview-magic-tricks-zoom-levels.aspx


    -Malleswar

    Friday, November 28, 2014 7:01 PM

All replies

  • Hi Chunde Huang,

    I don't think you can do this, basically when you have HTML page hosted in WebView, your app manipulation will be handled by HTML page instead of WebView. For instance if you click some button on HTML page, WebView will not fire a Tapped or Click event.

    To capture the zoom in/out (pinch) event, the easiest way is to handle it by JavaScript and use ScriptNotify event to pass the event out.

    --James


    <font color="0099FF"><THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED></font><br/> Thanks<br/> MSDN Community Support<br/> <br/> Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, November 28, 2014 3:31 PM
    Moderator
  • Hi,

    Please give a try with this. I guess, it will work Windows Phone as well.

    http://blogs.msdn.com/b/wsdevsol/archive/2013/05/28/webview-magic-tricks-zoom-levels.aspx


    -Malleswar

    Friday, November 28, 2014 7:01 PM