protected override void OnPointerReleased(PointerRoutedEventArgs e)
        {
            base.OnPointerReleased(e);
            base.OnPointerPressed(e);
            var currentPoint = e.GetCurrentPoint(this);
            var point = new Point(currentPoint.Position.X, currentPoint.Position.Y);

            var args = new FingerManipulationEventArgs { Point = point, Handled = true };

            OnFingerUp(args);
        }
        private void FrameOfReferenceOnMouseMove(object sender, FingerManipulationEventArgs args)
        {
            if (!IsDragging)
            {
                IsDragging = true;
                OnDragStarted();
            }

            var position = args.GetPosition(FrameOfReference);

            DragOperation.NotifyNewPosition(position);        
        }
        private void UIElementOnPointerReleased(object sender, PointerRoutedEventArgs pointerRoutedEventArgs)
        {
            var corePoint = pointerRoutedEventArgs.GetCurrentPoint(null);
            if (corePoint.Properties.IsLeftButtonPressed)
            {

                var fingerManipulationEventArgs = new FingerManipulationEventArgs();

                OnFingerUp(fingerManipulationEventArgs);

                pointerRoutedEventArgs.Handled = fingerManipulationEventArgs.Handled;
            }
        }
        private void UIElementOnPointerPressed(object sender, PointerRoutedEventArgs pointerRoutedEventArgs)
        {
            var pointerPoint = pointerRoutedEventArgs.GetCurrentPoint(null);
            if (pointerPoint.Properties.IsLeftButtonPressed)
            {
                var pointer = pointerRoutedEventArgs.Pointer;
                var corePoint = Mapper.Map<Point>(pointerPoint.Position);
                var fingerManipulationEventArgs = new FingerManipulationEventArgs { Pointer = pointer, Point = corePoint };

                OnFingerDown(fingerManipulationEventArgs);

                pointerRoutedEventArgs.Handled = fingerManipulationEventArgs.Handled;
            }
        }
        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 FrameOfReferenceOnMouseLeftButtonUp(object sender, FingerManipulationEventArgs args)
        {
            if (DragOperation != null)
            {
                var position = args.GetPosition(FrameOfReference);
                DragOperation.NotifyNewPosition(Mapper.Map<Point>(position));
                FrameOfReference.ReleaseInput(Pointer);
                FrameOfReference.FingerMove -= FrameOfReferenceOnMouseMove;
                DragOperation = null;                
                SnappingEngine.ClearSnappedEdges();

                IsDragging = false;
                Pointer = null;
                OnDragEnd();
            }
        }
        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();
            }
        }
        private void HandleOnMouseLeftButtonDown(object sender, FingerManipulationEventArgs args)
        {
            args.Handled = true;

            var inputElement = (IUserInputReceiver)sender;

            var handlePoint = Handles[inputElement];

            var absolutePoint = ConvertProportionalToAbsolute(handlePoint);

            ResizeOperation = new ResizeOperation(CanvasItem, absolutePoint, SnappingEngine);            
            Parent.CaptureInput(null);

            Parent.FingerMove += ParentOnMouseMove;
            Parent.FingerUp += ParentOnMouseLeftButtonUp;
        }
        protected override void OnPointerPressed(PointerRoutedEventArgs e)
        {
            base.OnPointerPressed(e);
            var currentPoint = e.GetCurrentPoint(this);

            if (currentPoint.Properties.IsLeftButtonPressed)
            {
                var point = new Point(currentPoint.Position.X, currentPoint.Position.Y);
                var args = new FingerManipulationEventArgs
                           {
                               Point = point, Handled = true, Pointer = e.Pointer,
                           };

                OnFingerDown(args);
            }
        }
예제 #10
0
        private void UIElementOnPreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs mouseButtonEventArgs)
        {
            var corePoint = mouseButtonEventArgs.GetPosition(null);
            var point = Mapper.Map<Point>(corePoint);

            var fingerManipulationEventArgs = new FingerManipulationEventArgs();
            OnFingerUp(fingerManipulationEventArgs);

            mouseButtonEventArgs.Handled = fingerManipulationEventArgs.Handled;
        }
예제 #11
0
        private void UIElementOnMouseMove(object sender, MouseEventArgs mouseEventArgs)
        {
            var corePoint = mouseEventArgs.GetPosition(null);
            var point = Mapper.Map<Point>(corePoint);

            var fingerManipulationEventArgs = new FingerManipulationEventArgs();
            OnFingerMove(fingerManipulationEventArgs);
            mouseEventArgs.Handled = fingerManipulationEventArgs.Handled;
        }
예제 #12
0
 protected virtual void OnFingerUp(FingerManipulationEventArgs args)
 {
     var handler = FingerUp;
     if (handler != null) handler(this, args);
 }
예제 #13
0
 private void UIElementOnPointerMoved(object sender, PointerRoutedEventArgs pointerRoutedEventArgs)
 {
     var fingerManipulationEventArgs = new FingerManipulationEventArgs();
     OnFingerMove(fingerManipulationEventArgs);
     pointerRoutedEventArgs.Handled = fingerManipulationEventArgs.Handled;
 }
        private void TargetOnPreviewMouseLeftButtonDown(object sender, FingerManipulationEventArgs fingerManipulationEventArgs)
        {
            fingerManipulationEventArgs.Handled = true;

            Pointer = fingerManipulationEventArgs.Pointer;

            var startingPoint = fingerManipulationEventArgs.GetPosition(FrameOfReference);

            DragOperation = new DragOperation(ItemToDrag, startingPoint, SnappingEngine);

            FrameOfReference.CaptureInput(Pointer);

            FrameOfReference.FingerMove += FrameOfReferenceOnMouseMove;
            FrameOfReference.FingerUp += FrameOfReferenceOnMouseLeftButtonUp;            
        }
예제 #15
0
 private void OnFingerUp(FingerManipulationEventArgs args)
 {
     var handler = FingerUp;
     if (handler != null) handler(this, args);
 }
예제 #16
0
 protected override void OnFingerDown(FingerManipulationEventArgs args)
 {
     base.OnFingerDown(args);
     RaiseNoneSpecified();
 }