示例#1
0
        private void Image_DragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            // if is not touch enabled or the scale is different than 1 then don’t allow moving
            if (ImageTransformation.ScaleX <= 1.1)
                return;

            double centerX = ImageTransformation.CenterX;
            double centerY = ImageTransformation.CenterY;
            double translateX = ImageTransformation.TranslateX;
            double translateY = ImageTransformation.TranslateY;
            double scale = ImageTransformation.ScaleX;
            double width = ComicImage.ActualWidth;
            double height = ComicImage.ActualHeight;

            // Verify limits to not allow the image to get out of area
            if (centerX - scale * centerX + translateX + e.HorizontalChange < 0 && centerX + scale * (width - centerX) + translateX + e.HorizontalChange > width)
            {
                ImageTransformation.TranslateX += e.HorizontalChange;
            }

            if (centerY - scale * centerY + translateY + e.VerticalChange < 0 && centerY + scale * (height - centerY) + translateY + e.VerticalChange > height)
            {
                ImageTransformation.TranslateY += e.VerticalChange;
            }

            return;
        }
        private void myGridGestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            foreach (var image in Images)
            {
                image.Item2.ImageShift += e.HorizontalChange;
                image.Item1.RefreshSettings(image.Item2);
            }

            var topImg = (Images.FirstOrDefault(i => i.Item2.IsOnTop));
            if (topImg != null)
            {
                var indexOfTopImage = Images.IndexOf(topImg);
                if (indexOfTopImage >= Images.Count - 1)
                {
                    var first = Images.First();
                    Images.Remove(first);
                    first.Item2.ImageShift = Images.Last().Item2.ImageShift + ImageSettings.ImageGap;
                    Images.Add(first);
                }
                else if (indexOfTopImage == 0)
                {
                    var last = Images.Last();
                    Images.Remove(last);
                    last.Item2.ImageShift = Images.First().Item2.ImageShift - ImageSettings.ImageGap;
                    Images.Insert(0, last);
                }
            }
        }
示例#3
0
        /// <summary>
        /// Moves the image around following your finger.
        /// </summary>
        private void OnDragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            var translationDelta = new Point(e.HorizontalChange, e.VerticalChange);

            if (IsDragValid(1, translationDelta))
                UpdateImagePosition(translationDelta);
        }
示例#4
0
 private void OnDragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     transform.TranslateX += e.HorizontalChange;
     transform.TranslateY += e.VerticalChange;
     //if (transform.TranslateY < -40)
     //    transform.TranslateY = -40;
 }
        private void DragDelta(object sender, Microsoft.Phone.Controls.DragDeltaGestureEventArgs e)
        {
            if (!m_canSwipe || m_cancelled)
            {
                return;
            }

            if (Math.Abs(e.VerticalChange) <= 3)
            {
                if (Math.Abs(e.HorizontalChange) > 0)
                {
                    TranslateTransform transform = (TranslateTransform)this.RenderTransform;
                    if (transform.X == 0)
                    {
                        if ((e.HorizontalChange > -5) && (e.HorizontalChange < 5))
                        {
                            return;
                        }
                    }
                    transform.X += e.HorizontalChange;
                    //transform.Y += e.VerticalChange;
                }
            }
            else
            {
                m_cancelled = true;
            }
        }
        private void OnDragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            Image rect = sender as Image;
            TranslateTransform transform = rect.RenderTransform as TranslateTransform;

            MyMustacheTransformation.TranslateX += e.HorizontalChange;
            MyMustacheTransformation.TranslateY += e.VerticalChange;
        }
示例#7
0
 private void OnGestureListenerDragDelta(object sender, DragDeltaGestureEventArgs args)
 {
     if (_isDragging)
     {
         translateTransform.X += args.HorizontalChange;
         translateTransform.Y += args.VerticalChange;
     }
 }
 private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     if (NavDrawMargin.left <= 400)
     {
         NavDrawMargin.left += e.HorizontalChange;
         LayoutRoot.Margin = new Thickness(0, NavDrawMargin.left, 0, 0);
     }
 }
        private void GestureListener_OnDragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalChange > 0 && !_isSettingsOpen)
                OpenSettings();

            if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalChange < 0 && _isSettingsOpen)
                CloseSettings();
        }
示例#10
0
 private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     if (uptansform.TranslateX >= 0 && uptansform.TranslateX <= 380)
     {
         uptansform.TranslateX += e.HorizontalChange;
         uptansform.TranslateX = (uptansform.TranslateX < 0) ?0: uptansform.TranslateX;
         uptansform.TranslateX = (uptansform.TranslateX >380) ? 380:uptansform.TranslateX;
     }
 }
示例#11
0
 private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     this.MenuList.IsHitTestVisible = false;
     if (uptansform.TranslateX >= 0 && uptansform.TranslateX <= 380)
     {
         uptansform.TranslateX += e.HorizontalChange;
         uptansform.TranslateX = (uptansform.TranslateX < 0) ? 0 : uptansform.TranslateX;
         uptansform.TranslateX = (uptansform.TranslateX > 380) ? 380 : uptansform.TranslateX;
     }
 }
示例#12
0
 private void OnDragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
     {
         PANEL_DRAG_HORIZONTAL += e.HorizontalChange;
         //Image img = imgList.SelectedItem as Image;
         //var baseLeft = -img.Width / 2;
         //if (PANEL_DRAG_HORIZONTAL > 75) img.RenderTransform.baseLeft + PANEL_DRAG_HORIZONTAL;
         //else if (PANEL_DRAG_HORIZONTAL < -75) imgImageTranslate.OffsetX = baseLeft + PANEL_DRAG_HORIZONTAL;
         //else imgImageTranslate.OffsetX = baseLeft;
     }
 }
        private void OnPageDragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            Grid g = sender as Grid;

            g.SetValue(Canvas.LeftProperty, _currentPageX + e.HorizontalChange);
            _currentPageX += e.HorizontalChange;

            if (_isZoomed)
            {
                g.SetValue(Canvas.TopProperty, _currentPageY + e.VerticalChange);
                _currentPageY += e.VerticalChange;
            }
        }
 private void OnGestureListenerDragDelta(object sender, DragDeltaGestureEventArgs args)
 {
     if (this.initialScale > 1.0)
     {
         this.transform.TranslateX = this.ComputeTranslateX(this.transform.TranslateX + args.HorizontalChange, this.initialScale);
         this.transform.TranslateY = this.ComputeTranslateY(this.transform.TranslateY + args.VerticalChange, this.initialScale);
     }
 }
示例#15
0
 void RecoverDiag_DragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     ((TranslateTransform)RecoverDialog.RenderTransform).X += e.HorizontalChange;
 }
示例#16
0
 private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     if (e.Direction == null)
     {
         if (e.VerticalChange > 10.0)
         {
             this.ReduceOpacity(e.VerticalChange);
         }
         if (e.VerticalChange < -10.0)
         {
             this.IncreaseOpacity(e.VerticalChange);
         }
     }
 }
示例#17
0
        private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalChange > 0 && !_isSettingsOpen)
            {
                double offset = _feContainer.GetHorizontalOffset().Value + e.HorizontalChange;
                if (offset > _dragDistanceToOpen)
                    this.OpenSettings();
                else
                    _feContainer.SetHorizontalOffset(offset);
            }

            if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalChange < 0 && _isSettingsOpen)
            {
                double offsetContainer = _feContainer.GetHorizontalOffset().Value + e.HorizontalChange;
                if (offsetContainer < _dragDistanceToClose)
                    this.CloseSettings();
                else
                    _feContainer.SetHorizontalOffset(offsetContainer);
            }
        }
 private void OnDragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     transform.CenterX = transform.CenterX - e.HorizontalChange;
     transform.CenterY = transform.CenterY - e.VerticalChange;
 }
		private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
		{
			var canvas = (Canvas)sender;
			var point = e.GetPosition(canvas);

			this.InvokePlaceLine(point);
		}
        private void GestureListener_DragDeltaInput(object sender, DragDeltaGestureEventArgs e)
        {
            //if (isOpenNavDraw)
            //{
            //    Donationpop.Margin = new Thickness(0, 0, 0, 0);
            //    isOpenNavDraw = false;
            //}

            //double temp = marginLeft + e.VerticalChange;
            //if (temp <= 0 && temp >= -800)
            //{
            //    marginLeft += e.VerticalChange;
            //    Donationpop.Margin = new Thickness(0, marginLeft, 0, 0);
            //}
        }
        private void GestureListenerDragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            if (!isDragging) {
                EnableScroll();
                return;
            }

            DisableScroll();

            var tile = (DisablingHubTile)sender;
            var grid = (TiltGrid)tile.Parent;
            var content = tiles.First(presenter => presenter.DataContext == grid.DataContext);

            var x = Canvas.GetLeft(content);
            x += e.HorizontalChange;
            Canvas.SetLeft(content, x);

            var y = Canvas.GetTop(content);
            y += e.VerticalChange;

            Canvas.SetTop(content, y);

            var cloudId = ((Cloud)grid.DataContext).id;
            var newindex = IndexForPosition(Canvas.GetLeft(content), Canvas.GetTop(content));
            var movement = newindex - PonyvilleDirectory.CloudIndex(cloudId);
            PonyvilleDirectory.MoveItem(cloudId, movement);

            Connection.CurrentCloudsdaleUser.clouds = Connection.CurrentCloudsdaleUser.clouds;
        }
示例#22
0
 private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     transform.TranslateX += e.HorizontalChange;
     transform.TranslateY += e.VerticalChange;
 }
示例#23
0
 private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
 {
 }
 /// <summary>
 /// Drag delta
 /// </summary>
 /// <param name="sender">Event sender</param>
 /// <param name="e">Event parameter</param>
 void GestureListener_DragDelta(
         object sender,
         DragDeltaGestureEventArgs e)
 {
   _mat.PostTranslate(e.HorizontalChange,
                      e.VerticalChange);
   _trans.Matrix = _mat.ToMatrix();
 }
示例#25
0
        private void OnDragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            if (isAnimating)
                return; 

            var translationDelta = new Point(e.HorizontalChange, e.VerticalChange);
            if (IsDragValid(1, translationDelta))
                UpdatePosition(translationDelta);

            e.Handled = true; 
        }
示例#26
0
 private void MapDragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     if (_mainViewModel.HeldUserPin == null || _touchedPin == null)
     {
         return;
     }
     var trans = (TranslateTransform) _touchedPin.RenderTransform;
     trans.X += e.HorizontalChange;
     trans.Y += e.VerticalChange;
 }
示例#27
0
 private void OnPushpinDragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     e.Handled = true;
     if (_context.DragPushpin == null)
     {
         return;
     }
     var transform = (CompositeTransform) DragPushpin.RenderTransform;
     transform.TranslateX += e.HorizontalChange;
     transform.TranslateY += e.VerticalChange;
 }
        private void listener_DragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            if (e.Direction != Orientation.Vertical)
            {
                return;
            }

            TimeSpan elapsed = DateTime.Now - _gestureStart;

            e.Handled = true;

            if (elapsed > _flickStopWaitTime || Math.Sign(e.VerticalChange) != Math.Sign(_lastFlickVelocity))
            {
                IsPanning = true;
                IsFlicking = false;

                if (_firstDragDuringFlick)
                {
                    StopScrolling();
                    _firstDragDuringFlick = false;
                }
                else
                {
                    AnimatePanel(_panDuration, _panEase, _dragTarget += e.VerticalChange);
                    IsStretching = IsBouncy && (GetCoercedScrollPosition(_dragTarget, true) != _dragTarget);
                }
            }
        }
 private void OnDragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     Canvas rect = sender as Canvas;
     TranslateTransform transform = rect.RenderTransform as TranslateTransform;
     // Move the rectangle
     PolylineTransformation.TranslateX += e.HorizontalChange;
     PolylineTransformation.TranslateY += e.VerticalChange;
 }
 private void gesture_DragDelta(object sender, DragDeltaGestureEventArgs e)
 {
     message.Text = string.Format("drag delta by ({0},{1}) in the {2} direction ", e.HorizontalChange, e.VerticalChange, e.Direction);
 }
 /// <summary>
 /// 拖拽事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnDrag_ManipulationDelta(object sender, DragDeltaGestureEventArgs e)
 {
     //moving along X axis
     _imgTrans.TranslateX += e.HorizontalChange;
     //moving along Y axis
     _imgTrans.TranslateY += e.VerticalChange;
 }