private void ParentOnMouseMove(object sender, FingerManipulationEventArgs args)
        {
            var position      = args.GetPosition(Parent);
            var parentPositon = ((IUIElement)Parent).GetPosition();
            var finalPoint    = position.Add(parentPositon);

            var newPoint = Mapper.Map <Point>(finalPoint);

            ResizeOperation.UpdateHandlePosition(newPoint);

            if (!IsDragging)
            {
                IsDragging = true;
                //OnDragStarted();
            }
        }
        private void ParentOnMouseLeftButtonUp(object sender, FingerManipulationEventArgs args)
        {
            if (ResizeOperation != null)
            {
                var position = args.GetPosition(Parent);
                ResizeOperation.UpdateHandlePosition(position);
                Parent.ReleaseInput(null);
                Parent.FingerMove -= ParentOnMouseMove;
                ResizeOperation.Dispose();
                ResizeOperation = null;
                SnappingEngine.ClearSnappedEdges();

                IsDragging = false;
                //OnDragEnd();
            }
        }
Пример #3
0
        public void IncreaseWidthTopRight()
        {
            var canvasItem = new CanvasModelItem
                             {
                                 Width = 30,
                                 Height = 30,
                                 Left = 10,
                                 Top = 20,
                             };

            var hookPoint = new Point(40, 20);
            var newPoint = new Point(50, 20);

            var resizeOperation = new ResizeOperation(canvasItem, newPoint , new NoEffectsCanvasItemSnappingEngine());
            resizeOperation.UpdateHandlePosition(newPoint);
            Assert.AreEqual(40D, canvasItem.Width);
        }