WhoKnows
WhoKnows

Reputation: 13

(UWP) ScrollViewer PanningMode - does it exist?

I really hope I'm not doing something stupid here, but I'm trying to make a (quick?) UWP Windows 10 test app of sorts which includes a ScrollViewer to do image scrolls. The ScrollViewer works fine until I try to use PanningMode, when it just says it doesn't exist. I saw one other post with PanningMode="Both" not working, but that wasn't helpful in the slightest, not getting to the problem I'm getting. Is it that I'm being stupid, like PanningMode not existing for some reason, or is there something wrong wrong? This is my MainPage.xaml (not optimised or made to any real standards at the moment though), I hope it's enough.

<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>

Upvotes: 0

Views: 733

Answers (1)

nico
nico

Reputation: 59

The PanningMode property specifies in WPF applications how the ScrollViewer should react to touch manipulation. You can determine whether it should scroll horizontally, vertically, or both. This is however not necessary in a UWP app, where the ScrollViewer automatically reacts to touch manipulation. That's why the property doesn't exist and you get an error.

Upvotes: 1

Related Questions