Over a million developers have joined DZone.

Windows Phone WebBrowser Control: Suppress Zoom and Scroll

DZone's Guide to

Windows Phone WebBrowser Control: Suppress Zoom and Scroll

· Mobile Zone
Free Resource

Discover how to focus on operators for Reactive Programming and how they are essential to react to data in your application.  Brought to you in partnership with Wakanda

Why would you ever want to suppress zoom and scroll?  Well, the WebBrowser control lets you view websites within the context of a non-browser application so that you don't end up opening the browser when you just want to peek at something.  In these cases, you may want to stop the user from zooming or scrolling if the whole page is displayed.

Colin Eberhardt shows in his blog post that there is a way to suppress zoom and scroll with HTML5, but he doesn't like that it lets you do both of these things and only snaps back.  He instead finds a solution through the .NET Wrapper - the PanZoomController:

If you inspect the visual tree of the WebBrowser control you will find that it is assembled as follows:

          \-Border (*)

(visual tree dump generated via the oh-so-useful Linq to VisualTree utility!)

You can check out Colin's blog to see the utility class he made with the help of PanZoomController to fully supress zoom and scroll.

Source: http://www.scottlogic.co.uk/blog/colin/2011/11/suppressing-zoom-and-scroll-interactions-in-the-windows-phone-7-browser-control/

Learn how divergent branches can appear in your repository and how to better understand why they are called “branches".  Brought to you in partnership with Wakanda


Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}