Scroll position of webcontrol in windows phone

113 views Asked by At

I wonder how can I save the scroll position of large html in webcontrol in windows phone lets say a bookmarking ?

Anyone knows?

1

There are 1 answers

2
BobHy On

One technique I have used:

WebBrowser.ScriptInvoke( "exec", "window.external.notify(
[window.outerWidth 
, window.outerHeight
, window.pageXOffset
, window.pageYOffset
, document.body.style.zoom
].join('|')");

and catch the resulting string in WebBrowser.ScriptNotify event handler.

This runs a javascript on any page the user has currently loaded, you don't need to modify the page itself. You must wait till the WebBrowser.LoadCompleted event to make sure the page is stable.

If you know user didn't zoom the web page, you wouldn't need the zoom, outerWidth and outerHeight.