You might need to implement a swiping behavior in a list similar to FlipView control. In FlipView, a swiping always ends at the center of an element. Unlike it works by default in ListViewBase control, where user can see many items at once and stopping points are randomly chosen. But FlipView is not really wanted, when it’s required to display left and right items. The behavior I needed to achieve:

I also override ItemsPanel in this XAML, because I want to show items in a horizontal panel.

Example.

Take a look at the example here. Launch the app at Windows mobile emulator and hit Snap points example button. As soon as the next page is being loaded and a list with images is being shown, swipe to the second item and immediately to the first one. You will notice a bug. The first item becomes unreachable. I fixed the issue with inserting empty items in the beginning and the end of the list:

1

2

3

4

5

6

7

privatevoidInsertEmptyItems(List<Image>images)

{

images.Insert(0,Image.Empty);

images.Insert(images.Count,Image.Empty);

}

GridView.ScrollIntoView() allows to make the first not empty item logically focused:

1

2

3

4

5

6

privatevoidScrollToFirstItem()

{

ImagesList.ScrollIntoView(ImagesList.Items[1]);

}

To make the example works fine, go to HorizontalSnapPointsPage.xaml.cs and undo commented InsertEmptyItems() and ScrollToFirstItem() methods. Swiping in the list works as expected now.