Inheritance: IGestureEngine
        public DoubleTapGestureEngine(double minMilliseconds, double gapMilliseconds, double maxMilliseconds, double maxMovement)
        {
            IsStarted   = false;
            IsCompleted = false;
            IsAborted   = false;

            firstTap = new TapGestureEngine(minMilliseconds, maxMilliseconds, maxMovement);
            firstTap.GestureAborted   += new EventHandler(firstTap_GestureAborted);
            firstTap.GestureCompleted += new EventHandler(firstTap_GestureCompleted);

            secondTap = new TapGestureEngine(minMilliseconds, maxMilliseconds, maxMovement);
            secondTap.GestureAborted   += new EventHandler(secondTap_GestureAborted);
            secondTap.GestureCompleted += new EventHandler(secondTap_GestureCompleted);

            _maxMilliseconds = maxMilliseconds;
            _gapMilliseconds = gapMilliseconds;
            _minMilliseconds = minMilliseconds;
            _maxMovement     = maxMovement;

            _timer          = new DispatcherTimer();
            _timer.Interval = TimeSpan.FromMilliseconds(_gapMilliseconds);
            _timer.Tick    += (s, ee) =>
            {
                AbortGesture();
            };
        }
Example #2
0
    public DoubleTapGestureEngine(double minMilliseconds, double gapMilliseconds, double maxMilliseconds, double maxMovement)
    {
      IsStarted = false;
      IsCompleted = false;
      IsAborted = false;

      firstTap = new TapGestureEngine(minMilliseconds, maxMilliseconds, maxMovement);
      firstTap.GestureAborted += firstTap_GestureAborted;
      firstTap.GestureCompleted += firstTap_GestureCompleted;
      
      secondTap = new TapGestureEngine(minMilliseconds, maxMilliseconds, maxMovement);
      secondTap.GestureAborted += secondTap_GestureAborted;
      secondTap.GestureCompleted += secondTap_GestureCompleted;

      _maxMilliseconds = maxMilliseconds;
      _gapMilliseconds = gapMilliseconds;
      _minMilliseconds = minMilliseconds;
      _maxMovement = maxMovement;

      _timer = new DispatcherTimer();
      _timer.Interval = TimeSpan.FromMilliseconds(_gapMilliseconds);
      _timer.Tick += (s, ee) =>
      {
        AbortGesture();
      };
    }