(UWP)ScrollViewer PanningMode - 它存在吗?

时间:2016-01-20 17:41:02

标签: uwp scrollviewer windows-10-universal

我真的希望我不会在这里做一些愚蠢的事情,但我试图制作一个(快速?)UWP Windows 10测试应用程序,包括一个ScrollViewer来做图像滚动。 ScrollViewer工作正常,直到我尝试使用PanningMode,它只是说它不存在。我看到另一篇帖子有PanningMode =" Both"没有工作,但这丝毫没有帮助,没有解决我遇到的问题。难道我是愚蠢的,就像PanningMode由于某种原因不存在,还是有错误的错误?这是我的MainPage.xaml(虽然目前没有针对任何真正的标准进行优化或制作),我希望它已经足够了。

<Page
x:Class="NewLunderground.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:NewLunderground"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <ScrollViewer x:Name="ScrollusViewus" HorizontalAlignment="Left" VerticalAlignment="Top" ZoomMode="Enabled" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Visible" PanningMode="Both"  Height="Auto" Width="Auto">
        <Image x:Name="mapImage" HorizontalAlignment="Left" VerticalAlignment="Top" Source="Assets/map.png" Stretch="None" ManipulationMode="All" ScrollViewer.HorizontalScrollBarVisibility="Visible" Width="Auto" Height="Auto"/>
    </ScrollViewer>

</Grid>

1 个答案:

答案 0 :(得分:0)

PanningMode属性在WPF应用程序中指定ScrollViewer应如何对触摸操作做出反应。您可以确定它是水平,垂直还是两者都滚动。然而,这在UWP应用程序中不是必需的,其中ScrollViewer自动对触摸操作作出反应。这就是为什么该属性不存在而你得到一个错误。