private void service_DragStarted(object sender, InteractiveDragStartedEventArgs e)
        {
            if (!CanStartWork(e) || ImageViewer.Image == null || IsWorking)
            {
                return;
            }

            OnWorkStarted(EventArgs.Empty);
        }
        private void interactiveService_DragStarted(object sender, InteractiveDragStartedEventArgs e)
        {
            if (CanStartWork(e) && !e.IsMouseWheel)
            {
                OnWorkStarted(EventArgs.Empty);

                var annArgs = ConvertPointerEventArgs(e, false);
                if (!e.IsHandled)
                {
                    this.WorkAutomationControl.OnAutomationPointerDown(annArgs);
                    e.IsHandled = annArgs.IsHandled;

                    if (!e.IsHandled)
                    {
                        OnWorkCompleted(EventArgs.Empty);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void service_DragStarted(object sender, InteractiveDragStartedEventArgs e)
        {
            if (!CanStartWork(e) || _controlPoints == null)
            {
                return;
            }

            // See if we are on any of our handles first
            // IMPORTANT NOTE: The SelectAreaView we render the control points inside and the shaded area is added to the image viewer item itself
            // and not on the whole image viewer control so we need to map the touch points to item coordinates.
            var testPoint  = ImageViewer.ConvertPoint(null, ImageViewerCoordinateType.Control, ImageViewerCoordinateType.Item, e.Position);
            int thumbIndex = HitTestThumb(testPoint, _controlPoints, _thumbSize);

            if (thumbIndex != -1)
            {
                // We have a hit
                _dragThumbIndex = thumbIndex;
            }
            else
            {
                // Check if we are inside the rectangle, move all of it
                LeadRect selectedAreaRect = GetSelectedAreaRectangle(true);
                if (selectedAreaRect.Contains(testPoint))
                {
                    _isDraggingBody = true;
                }
            }

            if (_dragThumbIndex != -1 || _isDraggingBody)
            {
                // So other interactive modes do not get this event
                e.IsHandled = true;
            }

            if (e.IsHandled)
            {
                OnWorkStarted(EventArgs.Empty);
            }
        }