Blake.NUI.WPF.Gestures.Events.RegisterGestureEventSupport C# (CSharp) Method

RegisterGestureEventSupport() public static method

Registers a framework element for gesture recognition. Any element below the root element will be eligable for gesture events and events bubble through the tree like normal routed events
public static RegisterGestureEventSupport ( FrameworkElement root ) : void
root System.Windows.FrameworkElement The root element where gesture support should be supported. This element and any element below it in the tree will get gesture support
return void
    public static void RegisterGestureEventSupport(FrameworkElement root)
    {
      // TODO: should we allow an element to unregister?
      EngineHandlerBase engine = null;
      engine = new EngineHandler(() => new HoldGestureEngine(HoldGestureTimeout, HoldMaxMovement), root, false);
      engine.GestureCompleted += (s, e) => e.Source.RaiseEvent(new GestureEventArgs(HoldGestureEvent, e.TouchDevice));

      engine = new EngineHandler(() => new TapGestureEngine(TapMinMilliseconds, TapMaxMilliseconds, TapMaxMovement), root, false);
      engine.GestureCompleted += (s, e) => e.Source.RaiseEvent(new GestureEventArgs(TapGestureEvent, e.TouchDevice));

      engine = new MultiEngineHandler(() => new DoubleTapGestureEngine(TapMinMilliseconds, DoubleTapGapMilliseconds, TapMaxMilliseconds, TapMaxMovement), root, false);
      engine.GestureCompleted += (s, e) => e.Source.RaiseEvent(new GestureEventArgs(DoubleTapGestureEvent, e.TouchDevice));
    }