I'm developing an App for WP8 using Visual Studio 2013. I used the WPToolkit to integrate the WebBrowser control.
I'm displaying static information in my WebBrowser control with changes just to the text using the following function.
Private Function CreateHtmlDocument() As String
Dim strHtmlDoc As String = ""
strHtmlDoc = "<html>"
strHtmlDoc = strHtmlDoc & "<head>"
strHtmlDoc = strHtmlDoc & "<meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no';>"
strHtmlDoc = strHtmlDoc & "</head>"
strHtmlDoc = strHtmlDoc & "<style type='text/css'>"
strHtmlDoc = strHtmlDoc & "body{ -ms-touch-action: none !important; -ms-content-zooming:none; -ms-scroll-limit-y-max :auto;}"
strHtmlDoc = strHtmlDoc & "</style>"
strHtmlDoc = strHtmlDoc & "<body>"
strHtmlDoc = strHtmlDoc & "<span style='color:#bf2e1a'><b><font face='Times New Roman' size='3'>" & clsGlobalVariables.branch & "</font></b></span>"
strHtmlDoc = strHtmlDoc & "<br> <span style='color:#c1481a'><font face='Times New Roman' size='2'>" & clsGlobalVariables.company_name & "<br> (Legal Name : " & clsGlobalVariables.legal_name & ")</font></span>"
strHtmlDoc = strHtmlDoc & "<br> <span style='color:#878270'><p align='left'><font face='Arial' size='2'>" & clsGlobalVariables.address & "</font></p> </span>"
strHtmlDoc = strHtmlDoc & "<span style='color:#878270'><font face='Arial' size='2'>Tel :</span> <span style='color:blue'>" & clsGlobalVariables.telephone & "</font></span>"
strHtmlDoc = strHtmlDoc & "<br> <span style='color:#878270'><font face='Arial' size='2'>Fax :</span> <span style='color:blue'>" & clsGlobalVariables.fax & "</font></span>"
strHtmlDoc = strHtmlDoc & "<br> <span style='color:#878270'><font face='Arial' size='2'>Email :</span> <span style='color:blue'>" & clsGlobalVariables.email & "</font></span>"
strHtmlDoc = strHtmlDoc & "<br>"
strHtmlDoc = strHtmlDoc & "<br>"
strHtmlDoc = strHtmlDoc & "</body>"
strHtmlDoc = strHtmlDoc & "</html>"
Return strHtmlDoc
End Function
Unfortunately, I can't seem to disable Pinch Zoom. Thankfully, double-tap zoom doesn't work. Also, the scroll is bugged in that it scrolls beyond my data and shows blank space in my control.
Some Image Links(Still don't have 10 Rep) -
http://i.stack.imgur.com/eifhn.jpg - How it looks normally.
http://i.stack.imgur.com/0panl.jpg - It zooms too much.
http://i.stack.imgur.com/znf5y.jpg - It scrolls way below the text.
I already tried http://www.scottlogic.com/blog/2011/11/17/suppressing-zoom-and-scroll-interactions-in-the-windows-phone-7-browser-control.html . It doesn't work for WP8.
My XAML -
<Grid HorizontalAlignment="Left" Height="320" Margin="10,274,0,0" Grid.Row="1" VerticalAlignment="Top" Width="460">
<phone:WebBrowser x:Name="webBrowser" HorizontalAlignment="Left" Height="320" IsScriptEnabled="True" VerticalAlignment="Top" Width="460" BorderThickness="2" BorderBrush="OrangeRed" ScrollViewer.VerticalScrollBarVisibility="Auto"/>
</Grid>