Bohrend
Bohrend

Reputation: 1497

How to scroll the enitre Windows Phone page with webbrowser content?

I have a webbrowser in my page, with other controls, I simply just want to scroll the entire page, instead of only scrolling the webbrowser. how can I do this?

my code:

 <ScrollViewer >
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.Resources>
            <convertstring:htmlconverter x:Name="htmlconv"/>
            <convertstring:DateTimeToStringConverter x:Name="datetimestringconverter"/>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="200"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Image Source="/Images/smallerheading.png"
               Margin="0,0,10,0"

               Grid.Column="1"/>

        <TextBlock Text="Stuff" 
               Foreground="Black"
               FontSize="45"
               Margin="15,5,0,0"
               />

        <Image Grid.Row="1" Grid.ColumnSpan="2"
               HorizontalAlignment="Center"
               VerticalAlignment="Center"
               x:Name="img"/>

        <TextBlock Grid.Row="2" 
                   x:Name="txtTitle"
               TextWrapping="Wrap" 
               Grid.ColumnSpan="2"
               FontSize="30" 
               Foreground="Black" />

        <StackPanel Grid.Row="3">
            <TextBlock Grid.Column="0"
                       x:Name="Autho"
               TextWrapping="Wrap"
               Foreground="Black"/>

            <TextBlock  
               Foreground="Black"
                x:Name="txtDate"/>
        </StackPanel>

        <phone:WebBrowser x:Name="webbrowsercontrol"
                      Grid.Row="4"
                      Background="Transparent"
                      Foreground="Black"
                      Grid.ColumnSpan="2"
                      FontSize="20">
        </phone:WebBrowser>
    </Grid>
</ScrollViewer>

Upvotes: 0

Views: 242

Answers (1)

meneses.pt
meneses.pt

Reputation: 2616

If you don't want to scroll the WebBrowser at all, you can draw a Border that is almost transparent (like #01000000).

That way, your touch movements will not be handled by the WebBrowser, but by the Border and the page will scroll instead of the WebBrowser content.

Upvotes: 1

Related Questions