ellic
ellic

Reputation: 798

Disable zooming in and out of scrollviewer in Windows 8 metro app

I am using RichTextBlock to show some text, and the RichTextBlock is in a scrollviewer, the code is shown as below:

<ScrollViewer Grid.Column="0">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <StackPanel Orientation="Vertical" Margin="12,0">
                    <TextBlock x:Name="TitleRun" FontSize="26" FontWeight="SemiBold" />
                </StackPanel>
                <RichTextBlock x:Name="MRichTextBlock" Grid.Row="1" Padding="12" FontSize="18">
                </RichTextBlock>
            </Grid>
        </ScrollViewer>

When my app is runing in a tablet pc, as long as I use two fingers to pinch in and out at the scrollviewer area, the RichTextBlock will zoom in or out, which is not expected.

So I'm wondering how to disable the zooming behavior in this situation.

Thanks in advance.

Upvotes: 2

Views: 2263

Answers (1)

ellic
ellic

Reputation: 798

From MSDN, setting ZoomMode=Disabled in ScrollViewer will work.

Upvotes: 9

Related Questions