예제 #1
0
        public PointersEvents()
        {
            _logPointerPressed = new PointerEventHandler((snd, e) =>
            {
                CreateHandler(PointerPressedEvent, "Pressed", _ptPressedHandle)(snd, e);
                if (_ptPressedCapture.IsChecked ?? false)
                {
                    ((UIElement)snd).CapturePointer(e.Pointer);
                }
            });

            this.InitializeComponent();

            _logPointerEntered        = new PointerEventHandler(CreateHandler(PointerEnteredEvent, "Entered", _ptEnteredHandle));
            _logPointerMoved          = new PointerEventHandler(CreateHandler(PointerMovedEvent, "Moved", _ptMovedHandle));
            _logPointerReleased       = new PointerEventHandler(CreateHandler(PointerReleasedEvent, "Released", _ptReleasedHandle));
            _logPointerExited         = new PointerEventHandler(CreateHandler(PointerExitedEvent, "Exited", _ptExitedHandle));
            _logPointerCanceled       = new PointerEventHandler(CreateHandler(PointerCanceledEvent, "Canceled", _ptCanceledHandle));
            _logPointerCaptureLost    = new PointerEventHandler(CreateHandler(PointerCaptureLostEvent, "CaptureLost", _ptCaptureLostHandle));
            _logManipulationStarting  = new ManipulationStartingEventHandler(CreateHandler(ManipulationStartingEvent, "Manip starting", _manipStartingHandle));
            _logManipulationStarted   = new ManipulationStartedEventHandler(CreateHandler(ManipulationStartedEvent, "Manip started", _manipStartedHandle));
            _logManipulationDelta     = new ManipulationDeltaEventHandler(CreateHandler(ManipulationDeltaEvent, "Manip delta", _manipDeltaHandle));
            _logManipulationCompleted = new ManipulationCompletedEventHandler(CreateHandler(ManipulationCompletedEvent, "Manip completed", _manipCompletedHandle));
            _logTapped       = new TappedEventHandler(CreateHandler(TappedEvent, "Tapped", _gestureTappedHandle));
            _logDoubleTapped = new DoubleTappedEventHandler(CreateHandler(DoubleTappedEvent, "DoubleTapped", _gestureDoubleTappedHandle));

            _log.ItemsSource           = _eventLog;
            _pointerType.ItemsSource   = Enum.GetNames(typeof(PointerDeviceType));
            _pointerType.SelectedValue = PointerDeviceType.Touch.ToString();
            _manipMode.ItemsSource     = _manipulationModes.Keys;
            _manipMode.SelectedValue   = _manipulationModes.First().Key;

            _isReady = true;
            OnConfigChanged(null, null);
        }
예제 #2
0
        internal static new void InvokeHandler(Delegate handler, IntPtr sender, IntPtr args)
        {
            ManipulationStartingEventHandler handler_ = (ManipulationStartingEventHandler)handler;

            if (handler_ != null)
            {
                handler_(Extend.GetProxy(sender, false), new ManipulationStartingEventArgs(args, false));
            }
        }