using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace SL_TouchPanel
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            Microsoft.Xna.Framework.Input.Touch.TouchPanel.EnabledGestures = Microsoft.Xna.Framework.Input.Touch.GestureType.DoubleTap;
        }

        private void PhoneApplicationPage_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
        {
            //Sind Gesten vorhanden?
            if (Microsoft.Xna.Framework.Input.Touch.TouchPanel.IsGestureAvailable)
            {
                //Geste auslesen
                Microsoft.Xna.Framework.Input.Touch.GestureSample gs = Microsoft.Xna.Framework.Input.Touch.TouchPanel.ReadGesture();
                //Gestentyp überprüfen
                if (gs.GestureType == Microsoft.Xna.Framework.Input.Touch.GestureType.DoubleTap)
                {
                    //Automatisches zurückspulen
                    DoubleTapAnimation.AutoReverse = true;
                    //Animation starten
                    DoubleTapAnimation.Begin();
                }
            }
        }
    }
}
