Is there a way I can catch the flicked direction of the Panorama in WP8 by overriding its manipulation events.
I need to make a decision based on which direction it being swiped to.
Is there a way I can catch the flicked direction of the Panorama in WP8 by overriding its manipulation events.
I need to make a decision based on which direction it being swiped to.
I dont know how to catch the flick but I know how to know if the user is sliding to right or to left. Maybe, this will fit your need.
We are going to use the event SelectionChanged
.
We have a list of PanoramaItem like this :
<phone:Panorama x:Name="SamplePanorama" SelectionChanged="SamplePanorama_SelectionChanged">
<phone:PanoramaItem Header="Sample1" Tag="sample1" />
<phone:PanoramaItem Header="Sample2" Tag="sample2" />
<phone:PanoramaItem Header="Sample3" Tag="sample3" />
</phone:Panorama>
And in your C# :
private void Panorama_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count < 1) return;
if (!(e.AddedItems[0] is PanoramaItem)) return;
PanoramaItem selectedItem = e.AddedItems[0] as PanoramaItem;
string tag = selectedItem.Tag.ToString();
if (tag.Equals("sample2"))
// user flick from right to left
else if (tag.Equals("sample3"))
// user flick from left to right
}