I'm looking for a control that allows me to swipe through a list of items. Swiping horizontally would move between the next and previous items. The control would also ensure the selected item is moved to the center when not being manipulated. This control will only take up half of the page and I'd like the options to the left and right to be visible and wrap around.
Like so
<-->
*][**][*
So my question is, does a control like this already exists and if so what is it called?
This is super easy if you use the GestureService from the Silverlight Toolkit. Simply implement a handler for the Flick event, and analyse the directory and velocity.
XAML
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Flick="GestureListener_Flick" />
</toolkit:GestureService.GestureListener>
C#
private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
{
if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
{
if (e.HorizontalVelocity < 0)
{
// flick right
}
else
{
// flick left
}
}
else
{
if (e.VerticalVelocity < 0)
{
// flick up
}
else
{
// flick down
}
}
}
There is no standard control which meets this description.
If you really want this then you'll have to create it yourself.