Ejemplo n.º 1
0
        void c_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            Canvas c = sender as Canvas;

            if (c == null)
            {
                return;
            }
            if (!c.Children.Contains(hl))
            {
                c.Children.Add(hl);
            }

            hl.X1 = 0;
            hl.X2 = c.ActualWidth;
            hl.Y1 = hl.Y2 = e.GetCurrentPoint(c).Position.Y;
            if (!c.Children.Contains(vl))
            {
                c.Children.Add(vl);
            }

            vl.Y1 = 0;
            vl.Y2 = c.ActualHeight;
            vl.X1 = vl.X2 = e.GetCurrentPoint(c).Position.X;
        }
        private async void flexChart_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if (_vm.IsBusy)
            {
                return;
            }

            if (e.GetCurrentPoint(flexChart).Properties.IsLeftButtonPressed)
            {
                var pos     = e.GetCurrentPoint(flexChart);
                var hitInfo = flexChart.HitTest(pos.Position);
                if (hitInfo != null && hitInfo.Distance < 2)
                {
                    _currentValue      = hitInfo.X;
                    tbWaitMessage.Text = Strings.WaitMessage;

                    Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Wait, 1);
                    Debug.WriteLine("Start fetching details");
                    IEnumerable <object> data = await _vm.FetchDataAsync(_vm.AsyncDrillDownManager.DrillDownLevel, _currentValue);

                    Debug.WriteLine("Fetching details completed");

                    tbWaitMessage.Text = "";

                    Windows.UI.Xaml.Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Arrow, 2);
                    _vm.AsyncDrillDownManager.DrillDown(data);
                }
            }
            flexChart.Invalidate();
        }
Ejemplo n.º 3
0
        void DragBar_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            // only when we are dragging...
            if (this.dragging)
            {
                Point position = e.GetCurrentPoint(sender as UIElement).Position;


                currentCanvasPosition.X = Canvas.GetLeft(this.MainDraggableControl) + position.X - this.lastDragPosition.X;
                currentCanvasPosition.Y = Canvas.GetTop(this.MainDraggableControl) + position.Y - this.lastDragPosition.Y;

                // Move the panel
                Canvas.SetLeft(this.MainDraggableControl, currentCanvasPosition.X);
                Canvas.SetTop(this.MainDraggableControl, currentCanvasPosition.Y);

                // if the absolute position of the draggable element is inside of one of
                // the droptargets applying, fire the correct events

                CheckIfIAmInDropTarget();


                // Fire the drag moved event
                if (this.DragMoved != null)
                {
                    this.DragMoved(this, new DragEventArgs(position.X - this.lastDragPosition.X, position.Y - this.lastDragPosition.Y, e));
                }

                // Update the last mouse position
                this.lastDragPosition = e.GetCurrentPoint(sender as UIElement).Position;
            }
        }
        private void Border_PointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            _lastMultiPoint.Clear();
            _currentMutilPoint.Clear();
            FingerCount--;
            e.Handled = true;
            MouseDown = false;
            if (FingerCount > 1 || MultiTouch)
            {
                return;
            }

            if (_pointerCaptured)
            {
                LayoutRoot.ReleasePointerCapture(e.Pointer);
                _pointerCaptured = false;
            }

            var point = e.GetCurrentPoint(LayoutRoot).Position;

            //Debug.WriteLine($"InputHandlerRenderer - Border_PointerReleased xy:{point.X},{point.Y} rect:{LayoutRoot.ActualWidth},{LayoutRoot.ActualHeight}");

            if (!e.GetCurrentPoint(LayoutRoot).Properties.IsRightButtonPressed)
            {
                Element.TouchEnd?.Invoke(new InputHandler.TouchEventArgs
                {
                    X = (int)point.X,
                    Y = (int)point.Y,
                });
            }
        }
Ejemplo n.º 5
0
        private void Canvas_Released(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if (!moved)
            {
                Point3D holoPoint = HoloPoints.Instance.GetHoloPoint((float)e.GetCurrentPoint(PointerCanvas).Position.X, (float)e.GetCurrentPoint(PointerCanvas).Position.Y);

                if (holoPoint != null)
                {
                    PostHoloPoints(holoPoint);
                }

                DebugTxt.Text = "X :" + e.GetCurrentPoint(PointerCanvas).Position.X + " Y  " + e.GetCurrentPoint(PointerCanvas).Position.Y + " holoPoint.x:  " + holoPoint.x + " holoPoint.y:  " + holoPoint.y + " holoPoint.z:  " + holoPoint.z;
            }
            else
            {
                if (holoPointArr.Count > 0)
                {
                    PostHoloAnatationPoints();
                }
            }

            //DebugTxt.Text = "Released " + moved.ToString() + "  " + clicked.ToString();

            moved   = false;
            clicked = false;

            //clickTimer.Stop();
            interval = 0;
        }
Ejemplo n.º 6
0
        void TargetCanvas_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var pos = e.GetCurrentPoint(TargetCanvas);

            if (isMoving && pos.Properties.IsLeftButtonPressed)
            {
                var dx = e.GetCurrentPoint(TargetCanvas).Position.X - PointX;
                var dy = e.GetCurrentPoint(TargetCanvas).Position.Y - PointY;

                PointX = e.GetCurrentPoint(TargetCanvas).Position.X;
                PointY = e.GetCurrentPoint(TargetCanvas).Position.Y;

                CurrentX += dx;
                CurrentY += dy;
                Canvas.SetLeft(TargetControl, CurrentX);
                Canvas.SetTop(TargetControl, CurrentY);

                if (TargetControl.DataContext is DesignItem)
                {
                    (TargetControl.DataContext as DesignItem).InLinkList.ForEach(v =>
                    {
                        v.TargetX += dx;
                        v.TargetY += dy;
                    });
                    (TargetControl.DataContext as DesignItem).OutLinkList.ForEach(v =>
                    {
                        v.SourceX += dx;
                        v.SourceY += dy;
                    });
                }
                e.Handled = true;
            }
        }
        private void UcEditor_RightDown(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            // Only for Pen to avoid issue with LongPress becoming RightTap with Pen/Touch
            var uiElement = sender as UIElement;
            var p         = e.GetCurrentPoint(uiElement);

            if (e.Pointer.PointerDeviceType != Windows.Devices.Input.PointerDeviceType.Pen)
            {
                return;
            }

            if (!p.Properties.IsRightButtonPressed)
            {
                return;
            }

            _lastPointerPosition = new Graphics.Point((float)p.Position.X, (float)p.Position.Y);
            _lastSelectedBlock?.Dispose();
            _lastSelectedBlock = _editor.HitBlock(_lastPointerPosition.X, _lastPointerPosition.Y);

            if ((_lastSelectedBlock == null) || (_lastSelectedBlock.Type == "Container"))
            {
                _lastSelectedBlock?.Dispose();
                _lastSelectedBlock = _editor.GetRootBlock();
            }

            if (_lastSelectedBlock != null)
            {
                var globalPos = e.GetCurrentPoint(null).Position;
                DisplayContextualMenu(globalPos);
            }

            e.Handled = true;
        }
        /// <summary>
        /// When LockZoom is enabled it will allow to ZoomIn into a specific clicked region using Mouse Right Button or
        /// return to overview by Mouse Left button click
        /// </summary>
        private void PDFViewCtrl_PointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if (LockZoom && PDFViewCtrl.HasDocument)
            {
                if (e.Pointer.PointerDeviceType == PointerDeviceType.Mouse)
                {
                    var p = e.GetCurrentPoint((UIElement)sender);
                    if (p.Properties.IsLeftButtonPressed)
                    {
                        Task.Delay(1);
                        PDFViewCtrl.SetZoom((int)(PDFViewCtrl.ActualWidth / 2), (int)(PDFViewCtrl.ActualWidth / 2), DEFAULT_ZOOM_START_POSITION);
                    }
                    else
                    {
                        Windows.Foundation.Point pt = e.GetCurrentPoint(_pDFViewCtrl).Position;
                        var    zoomFactor           = DEFAULT_ZOOM_REGION_STEP; // Amount of zoom on each call
                        double currentZoom          = PDFViewCtrl.GetZoom();    // Get current zoom

                        var width  = (int)(pt.X);                               // Get selected X coordinate
                        var height = (int)(pt.Y);                               // Get selected Y coordinate

                        PDFViewCtrl.SetZoom(width, height, currentZoom * zoomFactor);
                    }
                }
            }
            e.Handled = true;
        }
Ejemplo n.º 9
0
        private void VisualizationCanvas_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var punteroX = e.GetCurrentPoint(this.VisualizationCanvas).Position.X;
            var punteroY = e.GetCurrentPoint(this.VisualizationCanvas).Position.Y;


            txtResult.Text = punteroX.ToString() + " - " + punteroY.ToString();
        }
Ejemplo n.º 10
0
        void po_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            FrameworkElement item = sender as FrameworkElement;

            StartPoint.Y = e.GetCurrentPoint((UIElement)item.Parent).Position.Y;
            StartPoint.X = e.GetCurrentPoint((UIElement)item.Parent).Position.X;
            IsDrawing    = true;
        }
Ejemplo n.º 11
0
 void CurrentLinePointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     var layer = sender as Canvas;
     if (layer == null) return;
     VLine.Y1 = 0;
     VLine.Y2 = layer.ActualHeight;
     VLine.X1 = VLine.X2 = e.GetCurrentPoint(layer).Position.X;
     HLine.X1 = 0;
     HLine.X2 = layer.ActualWidth;
     HLine.Y1 = HLine.Y2 = e.GetCurrentPoint(layer).Position.Y;
 }
Ejemplo n.º 12
0
        private void handleUp(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var tms = DateTime.Now.Subtract(_currentInkDelays[_currentInkDelays.Count - 1]).TotalMilliseconds;

            _currentInkStroke.IsPause |= tms > 100;
            ReleasePointerCapture(e.Pointer);
            _currentInkStroke.Add(new Point(e.GetCurrentPoint(this).Position.X, e.GetCurrentPoint(this).Position.Y));
            removeDrawingInkStroke(_currentInkStroke);
            fireInkCollected(_currentInkStroke);
            _currentInkStroke = null;
            _isPointerPressed = false;
        }
Ejemplo n.º 13
0
        // Pointer Move
        private void _canvas_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            int tempY = (int)(e.GetCurrentPoint(_canvas).Position.Y / SizeOfCells);
            int tempX = (int)((e.GetCurrentPoint(_canvas).Position.X) / SizeOfCells);

            if ((_tempPositionY != tempY || _tempPositionX != tempX))
            {
                FocusLost();
                _tempPositionY = tempY;
                _tempPositionX = tempX;
                CellInFocus();
            }
        }
        private void CoreWindow_PointerWheelChanged(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if (Element == null)
            {
                return;
            }

            var point = e.GetCurrentPoint(LayoutRoot).Position;

            Element.MouseWheelPressed?.Invoke(
                e.GetCurrentPoint(LayoutRoot).Properties.MouseWheelDelta,
                point.X,
                point.Y);
        }
Ejemplo n.º 15
0
 protected override void OnPointerPressed(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
     {
         if (DefinitionSeriesIsSelectionEnabledHandling)
         {
             // DefinitionSeries-compatible handling
             if (!IsSelectionEnabled)
             {
                 // Prevents clicks from bubbling to background, but necessary
                 // to avoid letting ListBoxItem select the item
                 e.Handled = true;
             }
             base.OnPointerPressed(e);
         }
         else
         {
             // Traditional handling
             base.OnPointerPressed(e);
             if (IsSelectionEnabled)
             {
                 IsSelected = VirtualKeyModifiers.None == (VirtualKeyModifiers.Control & e.KeyModifiers);
                 e.Handled  = true;
             }
         }
     }
 }
Ejemplo n.º 16
0
        private void Grid_PointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            Windows.UI.Input.PointerPoint pointer = e.GetCurrentPoint(gameBoard);
            Tuple <Point, string>         result  = GetGridPosition(pointer);
            Point  pointerPosition = result.Item1;
            string pointerGrid     = result.Item2;

            if (pointerGrid.Equals("home"))
            {
                lock (hoverLock)
                {
                    if (hoveredShip != null)
                    {
                        lock (clickedLock)
                        {
                            clickedShip = hoveredShip;
                            DisplayError("");
                        }
                    }
                }
            }
            else if (pointerGrid.Equals("target"))
            {
                //TODO
                if (clickedShip == null && Globals.player.HasTurn)
                {
                    DisplayError("Must Select Ship First!");
                }
                else
                {
                    DisplayError("");
                }
            }
        }
        private void Border_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var point = e.GetCurrentPoint(LayoutRoot).Position;

            _lastMultiPoint[e.Pointer.PointerId] = point;

            FingerCount++;
            if (FingerCount > 1)
            {
                return;
            }

            _lastPoint = point;

            //Debug.WriteLine($"InputHandlerRenderer - Border_PointerPressed xy:{point.X},{point.Y} rect:{LayoutRoot.ActualWidth},{LayoutRoot.ActualHeight}");

            e.Handled = true;
            MouseDown = true;

            if (!_pointerCaptured)
            {
                LayoutRoot.CapturePointer(e.Pointer);
                _pointerCaptured = true;
            }


            //right click handling?

            Element.TouchBegin?.Invoke(new InputHandler.TouchEventArgs
            {
                X = (int)(point.X),
                Y = (int)(point.Y),
            });
        }
Ejemplo n.º 18
0
 private void Canvas_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     selectionStartIndex = GetHitIndex(e.GetCurrentPoint(canvas).Position);
     selectionEndIndex   = selectionStartIndex;
     canvas.Invalidate();
     e.Handled = true;
 }
Ejemplo n.º 19
0
        private void OnPointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var p = e.GetCurrentPoint(this);

            mousePosition = new PointF((float)p.Position.X, (float)p.Position.Y);
            mouseMoveThrottler.TryRun();
        }
Ejemplo n.º 20
0
        private void CustomStackLayoutRenderer_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var pointerPoint = e.GetCurrentPoint(this);

            point.Y = pointerPoint.Position.Y;
            point.X = pointerPoint.Position.X;
            var rowColumnIndex = SfDataGridHelpers.PointToCellRowColumnIndex(grid, point);
            var model          = (GridModel)grid.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("GridModel")).GetValue(grid);

            if (previousIndex == rowColumnIndex.RowIndex)
            {
                rowdata = SfDataGridHelpers.GetRowGenerator(grid).Items.FirstOrDefault(x => x.RowIndex == rowColumnIndex.RowIndex);
                if (rowdata != null)
                {
                    wholeRowElement = (VirtualizingCellsControl)rowdata.GetType().GetRuntimeFields().FirstOrDefault(x => x.Name.Equals("WholeRowElement")).GetValue(rowdata);
                    wholeRowElement.BackgroundColor = Xamarin.Forms.Color.Red;
                }
            }
            else
            {
                rowdata = SfDataGridHelpers.GetRowGenerator(grid).Items.FirstOrDefault(x => x.RowIndex == previousIndex);
                if (rowdata != null)
                {
                    wholeRowElement = (VirtualizingCellsControl)rowdata.GetType().GetRuntimeFields().FirstOrDefault(x => x.Name.Equals("WholeRowElement")).GetValue(rowdata);
                    wholeRowElement.BackgroundColor = Xamarin.Forms.Color.White;
                }
            }
            previousIndex = rowColumnIndex.RowIndex;
        }
Ejemplo n.º 21
0
        private void TextboxResult_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            ToolTip temp = ToolTipService.GetToolTip(textboxResult) as ToolTip;

            if (temp != null)
            {
                // current mouse position
                //var pointerPosition = Windows.UI.Core.CoreWindow.GetForCurrentThread().PointerPosition;
                //var x = pointerPosition.X - Window.Current.Bounds.X;
                //var y = pointerPosition.Y - Window.Current.Bounds.Y;
                //var ttv = textboxResult.TransformToVisual(Window.Current.Content);
                //var sc = ttv.TransformPoint(new Windows.Foundation.Point(0, 0));
                var tp = textboxResult.GetPositionFromPoint(e.GetCurrentPoint(textboxResult).Position);
                if (tp.Parent is Run run)
                {
                    if (_tooltipText.ContainsKey(run))
                    {
                        temp.Content = _tooltipText[run];
                        if (!temp.IsOpen)
                        {
                            temp.IsOpen = true;
                        }
                        e.Handled = true;
                    }
                }
            }
        }
Ejemplo n.º 22
0
        private void ThumbnailList_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            Vector2      offset = e.GetCurrentPoint(ThumbnailList).Position.ToVector2();
            ComboBoxItem item   = LightingSelection.SelectedValue as ComboBoxItem;

            switch ((LightingTypes)item.Tag)
            {
            case LightingTypes.PointDiffuse:
            case LightingTypes.PointSpecular:
                _pointLight.Offset = new Vector3(offset.X, offset.Y, 75);
                break;

            case LightingTypes.SpotLightDiffuse:
            case LightingTypes.SpotLightSpecular:
                _spotLight.Offset = new Vector3(offset.X, offset.Y, 150);
                break;

            case LightingTypes.DistantDiffuse:
            case LightingTypes.DistantSpecular:
                Vector3 position = new Vector3((float)ThumbnailList.ActualWidth / 2, (float)ThumbnailList.ActualHeight / 2, 200);
                Vector3 lookAt   = new Vector3((float)ThumbnailList.ActualWidth - offset.X, (float)ThumbnailList.ActualHeight - offset.Y, 0);
                _distantLight.Direction = Vector3.Normalize(lookAt - position);
                break;

            default:
                break;
            }
        }
 private void ChartGrid_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
 {
     // we start new action cycle by entering teh state where we first determine which action is starting
     _currentDirection = MoveDirection.Determining;
     _pointerDown      = e.GetCurrentPoint(chartGrid).Position;
     e.Handled         = true;
 }
Ejemplo n.º 24
0
        private void arborViewer1_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            Point     pt      = e.GetCurrentPoint(arborViewer1).Position;
            ArborNode resNode = arborViewer1.System.GetNearestNode((int)pt.X, (int)pt.Y);

            if (resNode == null)
            {
                if (fTipShow)
                {
                    //fTip.Hide(arborViewer1);
                    ToolTipService.SetToolTip(arborViewer1, null);
                    fTipShow = false;
                }
            }
            else
            {
                if (!fTipShow)
                {
                    fTip.Content = resNode.Sign;
                    ToolTipService.SetToolTip(arborViewer1, fTip);
                    //fTip.Show(resNode.Sign, arborViewer1, e.X + 24, e.Y);
                    fTipShow = true;
                }
            }
        }
Ejemplo n.º 25
0
 //PointerRoutedEventArgs
 public UwpLongPressEventArgs(Windows.UI.Xaml.FrameworkElement element, Windows.UI.Xaml.Input.PointerRoutedEventArgs args, long elapsedMilliseconds)
 {
     ViewPosition = element.GetXfViewFrame();
     //Touches = new Xamarin.Forms.Point[] { args.GetCurrentPoint(null).Position.ToXfPoint() };
     Touches  = new Xamarin.Forms.Point[] { args.GetCurrentPoint(element).Position.ToXfPoint() };
     Duration = elapsedMilliseconds;
 }
Ejemplo n.º 26
0
        void control_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var control = sender as LynxPhotoViewControl;

            control.PointerPressed -= control_PointerPressed;
            control.PointerMoved   -= control_PointerMoved;
            ActiveButtonBackground  = DeactiveBrush;
            if (control.getDrawObjectCanvas().Children.Contains(tl))
            {
                control.getDrawObjectCanvas().Children.Remove(tl);
            }

            (TestChart as ITEGrayscaleChart).ConstGradeL = ConstL;
            double h = e.GetCurrentPoint(control.getDrawObjectCanvas()).Position.Y / control.getImage().Height *control.getPhoto().PixelHeight;

            ActiveHeight = Convert.ToInt32(h);
            int v = (TestChart as ITEGrayscaleChart).getGrayGrade(ActiveHeight, TestAreaHeight, TestAreaWidth);

            LatitudeValue = v;
            ShowLatitude(ActiveHeight);

            if (LatitudeValue == 11)
            {
                ChartTestHelper.setGBSign(true, GBControl);
            }
            else
            {
                ChartTestHelper.setGBSign(false, GBControl);
            }
        }
Ejemplo n.º 27
0
        private void OnPointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if (!isCanTouch)
            {
                return;
            }

            if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse)
            {
                var p = e.GetCurrentPoint((UIElement)sender);
                if (!(p.Properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.LeftButtonReleased ||
                      p.Properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.RightButtonReleased))
                {
                    return;
                }

                if (p.Properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.LeftButtonReleased)
                {
                    OnTapped();
                }
                else if (p.Properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.RightButtonReleased)
                {
                    OnRightTapped();
                }
            }

            EndAnimationTap();
            OnFinishTapped();
        }
        private static void ListView_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            _instance = sender as Windows.UI.Xaml.Controls.ListViewBase;

            if (e.Pointer.PointerDeviceType != Windows.Devices.Input.PointerDeviceType.Mouse)
            {
                return;
            }

            var position = e.GetCurrentPoint(_instance).Position;
            var oldRate  = _rate;

            if (position.X < _threshold)
            {
                _rate = position.X - _threshold;
            }
            else if (_instance.ActualWidth - position.X < _threshold)
            {
                _rate = _threshold - (_instance.ActualWidth - position.X);
            }
            else
            {
                _rate = 0;
            }

            if (oldRate == 0 && _rate != 0)
            {
                var t = ScrollListView();
            }
        }
Ejemplo n.º 29
0
        private void SetActivePointer(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            var point         = e.GetCurrentPoint(TheCanvas);
            var worldPosition = (new MG.Vector2((float)point.Position.X, (float)point.Position.Y) - _screenOrigin) / _pixelsPerMeter;

            _activePoints[e.Pointer.PointerId] = worldPosition;
        }
        /// <summary>
        /// Called before the PointerPressed event occurs.
        /// </summary>
        /// <param name="e">Event data for the event.</param>
        protected override void OnPointerPressed(Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
        {
            if (_dragPointer != null)
            {
                return;
            }

            _dragPointer = e.Pointer.PointerId;
            _effectiveResizeDirection = this.DetermineEffectiveResizeDirection();
            _parentGrid = GetGrid();
            _previewDraggingStartPosition = e.GetCurrentPoint(_parentGrid).Position;
            _lastPosition = _previewDraggingStartPosition;
            _isDragging   = true;

            if (ShowsPreview)
            {
                //this.Dispatcher.Invoke(
                //    CoreDispatcherPriority.High,
                //    (s, e2) => StartPreviewDragging(e),
                //    this,
                //    null);
                StartPreviewDragging(e);
            }
            else
            {
                StartDirectDragging(e);
            }
        }