Saturday, 17 August 2013

Ways for playing storyboard Gesture events in Windows Phone using MVVM

Ways for playing storyboard Gesture events in Windows Phone using MVVM

I am using MVVM architecture on my application and therefore I am using
WP7Tools to fire Gesture events like OnFlickAction from my ViewModel
class.
My .xaml looks like that:
<Grid x:Name="ContentPanel">
<toolkit:GestureService.GestureListener>
<wp:GestureListenerEx OnFlickAction="Flick" />
</toolkit:GestureService.GestureListener>
<ScrollViewer>
<!-- Some content goes here -->
</ScrollViewer>
</Grid>
And I have a method with the name Flick in the ViewModel.
public void Flick(FlickGestureEventArgs e)
{
if (e.Direction == Orientation.Horizontal)
{
if (e.HorizontalVelocity < 0)
{
// slide to left
}
else if (e.HorizontalVelocity > 0)
{
// slide to right
}
}
}
What are the ways for playing storyboards in this scenario? Can I play
storyboard which was created in xaml? Could you show some examples also?
Thanks.

No comments:

Post a Comment