public virtual void ProcessPointDown(int pid, Point pt)
 {
     _pts[pid] = pt;
     UpdatePivot();
     _mprocessor.ProcessDown((uint)pid, (float)pt.X, (float)pt.Y);
 }
Exemple #2
0
 /// <summary>
 /// The ProcessDown method feeds data to the manipulation processor associated with a target
 /// </summary>
 /// <param name="manipulationId">The identifier for the manipulation that you want to process</param>
 /// <param name="location">The coordinates associated with the target</param>
 public void ProcessDown(uint manipulationId, PointF location)
 {
     _comManipulationProcessor.ProcessDown(manipulationId, location.X, location.Y);
 }
Exemple #3
0
        protected override void OnAttached()
        {
            _attachedElement = this.AssociatedObject;

            _attachedElement.PreviewStylusDown += (s, e) =>
            {
                if (Container == null)
                {
                    return;
                }
                MultitouchWindow.SafeCaptureStylus(e.StylusDevice, _attachedElement);
                e.Handled = true;
                Point pos = e.GetPosition(Container);
                UpdatePivot();
                _mprocessor.ProcessDown((uint)e.StylusDevice.Id, (float)pos.X, (float)pos.Y);
            };
            _attachedElement.PreviewStylusUp += (s, e) =>
            {
                if (Container == null)
                {
                    return;
                }
                MultitouchWindow.SafeCaptureStylus(e.StylusDevice, null);
                Point pos = e.GetPosition(Container);
                UpdatePivot();
                _mprocessor.ProcessUp((uint)e.StylusDevice.Id, (float)pos.X, (float)pos.Y);
            };
            _attachedElement.PreviewStylusMove += (s, e) =>
            {
                if (Container == null)
                {
                    return;
                }
                Point pos = e.GetPosition(Container);
                UpdatePivot();
                _mprocessor.ProcessMove((uint)e.StylusDevice.Id, (float)pos.X, (float)pos.Y);
            };

            _attachedElement.PreviewMouseDown += (s, e) =>
            {
                if (Container == null)
                {
                    return;
                }
                MultitouchWindow.SafeCaptureMouse(_attachedElement);
                e.Handled = true;
                Point pos = e.GetPosition(Container);
                UpdatePivot();
                _mprocessor.ProcessDown(1 << 30, (float)pos.X, (float)pos.Y);
            };

            _attachedElement.PreviewMouseUp += (s, e) =>
            {
                if (Container == null)
                {
                    return;
                }
                MultitouchWindow.SafeCaptureMouse(null);
                Point pos = e.GetPosition(Container);
                UpdatePivot();
                _mprocessor.ProcessUp(1 << 30, (float)pos.X, (float)pos.Y);
            };
            _attachedElement.PreviewMouseMove += (s, e) =>
            {
                if (Container == null)
                {
                    return;
                }
                Point pos = e.GetPosition(Container);
                UpdatePivot();
                _mprocessor.ProcessMove(1 << 30, (float)pos.X, (float)pos.Y);
            };
        }