放大到图像中的Windows Store应用程序

放大到图像中的Windows Store应用程序

问题描述:

我有一个ScrollViewer中,在它的图像控制。它显示一个相当大的图像。我希望我的用户能够放大到用手势形象。所以我启用的的ScrollViewer的ZoomMode。然而,ScrollViewer中自动滚动回当用户释放其手指,使进出图像无法有效放大图像的左边的边缘。

I have a ScrollViewer with an Image Control in it. It displays a rather large image. I want my user to be able to zoom into the image using gestures. I therefore enabled the ZoomMode on the Scrollviewer. However the Scrollviewer automatically scrolls back to the left "edge" of the image whenever the user releases its finger, making effectively zooming in and out of the image impossible.

这是我现在用的模板:

<DataTemplate x:Key="SingleItemTemplate">
    <ScrollViewer ZoomMode="Enabled">
        <Grid Margin="5,0,5,0">
            <Image Source="{Binding ImageUrlHighRes}">
            </Image>
        </Grid>
    </ScrollViewer>
</DataTemplate>



我怎样才能解决这个问题?

How can i solve this problem?

您需要启用水平滚动以及(默认为关闭)

You need to enable the horizontal scrolling as well (turned off by default)

HorizontalScrollBarVisibility = "Auto"