This article describes the Panning snap-points and provides how you can using this new interaction mechanism in your Windows Store application for good user experience.
Introduction of Panning snap-points
Snap-points can be set to aid users in getting to key locations in the content and act as a paging mechanism for the user. This will help the user to minimize excessive sliding in large pannable areas.
Panning snap-points are useful for applications such as photo albums or that have logical groupings of items that can be dynamically regrouped to fit within the display area.
There are five types of snap-points properties that you can set according to needs; they are:
- None: This means there no snap points to be set.
- Optional: User will snap Proximity Snap-Points.
- OptionSingle: Snap-points are optional.
- Mandatory: The content is always smoothly animated to a snap-point.
- MandtorySingle: Snap-points are mandatory and cannot be jumped over.
After going through all available snap-points now let's begin to implement this in a Windows Store Application.
First, open VS 2012 and choose a Blank Windows Store application using XAML.
Now, open the MainPage.xaml page and use the following code in it.
Here is the UI code:
<Grid x:Name="Parent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Margin="0,10,0,0" Grid.Row="1">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource BasicTextStyle}" VerticalAlignment="Center" Text="Select SnapPoint Type" />
<ComboBox x:Name="snapPointsCombo" SelectedIndex="0" SelectionChanged="ComboBox_SelectionChanged_1" >
<ComboBoxItem>None</ComboBoxItem>
<ComboBoxItem>Optional</ComboBoxItem>
<ComboBoxItem>Optional Single</ComboBoxItem>
<ComboBoxItem>Mandatory</ComboBoxItem>
<ComboBoxItem>Mandatory Single</ComboBoxItem>
</ComboBox>
</StackPanel>
<Button x:Name="scenario2Clear" Content="Reset" Margin="0,10,0,0" Click="Scenario2Reset" />
</StackPanel>
</Grid>
<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
<ScrollViewer x:Name="scrollViewer" Width="480" Height="270"
HorizontalAlignment="Left" VerticalAlignment="Top"


Farjana parveenPosted Jul 22, 2016, 2:59 AM
I have created the app based on the above code but i didn't faced any difference between the SnapPointsType enum