how to get swipe in windows phone 7

后端 未结 3 2129
轻奢々
轻奢々 2020-12-02 16:10

I want to swipe images in windows phone 7. Where do I begin from?

3条回答
  •  無奈伤痛
    2020-12-02 16:48

    Try this:

    using Microsoft.Phone.Controls;
    
    public partial class MyControl
    {
        public MyControl()
        {
            InitializeComponent();
    
            var gl = GestureService.GetGestureListener(asd);
            gl.Flick += new EventHandler(GestureListener_Flick);
        }
    
        private void GestureListener_Flick(object sender, FlickGestureEventArgs e)
        {
            if (e.Direction == Orientation.Horizontal)
            {
                if (e.HorizontalVelocity < 0) // determine direction (Right > 0)
                {
                    //Some Action
                }
                else
                {
                    //Some Action
                }
            }
        }
    }
    

提交回复
热议问题