Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display mixed HTML content without WebBrowser? (issues with ScrollViewer)

I want to display some HTML content in my WP7 application. I use the WebBrowser and it works very well. However, my WebBrowser is inside a ScrollViewer because I have some contents that are not HTML in the same page. So, I made my WebBrowser not scrollable and with a fixed height. But the control can't be higher than 2048px and I have some contents that are more than that. Therefore, it doesn't show the entire page and the text is cut. Here is the code :

<ScrollViewer>
<StackPanel Orientation="Vertical">
    <Image Height="240" HorizontalAlignment="Center" Stretch="{Binding ImageStretch}" Width="Auto" Source="{Binding Image}" />
    <TextBlock Text="{Binding Credit}" TextTrimming="WordEllipsis" />
    <TextBlock Text="{Binding Description}" TextWrapping="Wrap" IsHitTestVisible="False" />         
    <phone:WebBrowser Width="Auto" IsScriptEnabled="True" ScriptNotify="WebBrowserScriptNotify" IsHitTestVisible="False" />
</StackPanel>

And here is a screenshot of the problem: WebBrowser problem

So, is there any alternative to the WebBrowser control or is there a workaround ?

Thank you

like image 969
orel Avatar asked Apr 10 '12 09:04

orel


1 Answers

There is no alternative as far as I know, however, the solution to this similar question includes a simple algorithm for converting HTML into TextBlocks:

HTMLTextBlock for Windows Phone 7

like image 156
ColinE Avatar answered Oct 03 '22 22:10

ColinE