private void GestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
        {

            if (LayoutRoot.Margin.Bottom >= 200)
            {
                NavDrawMargin.left = 0;
                Deployment.Current.Dispatcher.BeginInvoke(delegate
                {
                    while (LayoutRoot.Margin.Left < 400)
                    {
                        NavDrawMargin.left = LayoutRoot.Margin.Bottom + 1;
                        LayoutRoot.Margin = new Thickness(0, NavDrawMargin.left, 0, 0);
                    }
                });
            }
            else
            {
                NavDrawMargin.left = 0;
                Deployment.Current.Dispatcher.BeginInvoke(delegate
                {
                    while (LayoutRoot.Margin.Bottom > 0)
                    {
                        NavDrawMargin.left = LayoutRoot.Margin.Bottom - 1;
                        LayoutRoot.Margin = new Thickness(0, NavDrawMargin.left, 0, 0);
                    }
                });
            }
        }
Beispiel #2
0
 private void OnGestureListenerDragCompleted(object sender, DragCompletedGestureEventArgs args)
 {
     if (_isDragging)
     {
         TransferTransforms();
         _isDragging = false;
     }
 }
        private void GestureListener_OnDragCompleted(object sender, DragCompletedGestureEventArgs 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();
        }
        private void DragCompleted(object sender, Microsoft.Phone.Controls.DragCompletedGestureEventArgs e)
        {
            if (!m_canSwipe)
            {
                return;
            }

            TranslateTransform transform = (TranslateTransform)this.RenderTransform;

            if (transform.X > 20.0d)
            {
                double offset = this.ActualWidth + 20.0d;

                this.Animate("Opacity", 200, 0.0d);
                this.Animate("(RenderTransform).(TranslateTransform.X)", 200, offset, (element) =>
                {
                    this.OnSwipeRight();

                    this.Animate("(RenderTransform).(TranslateTransform.X)", 200, offset, (element2) =>
                    {
                        transform   = (TranslateTransform)this.RenderTransform;
                        transform.X = -offset;

                        this.Animate("Opacity", 200, 1.0d);
                        this.Animate("(RenderTransform).(TranslateTransform.X)", 250, 0.0d);
                    });
                });
            }
            else if (transform.X < -20.0d)
            {
                double offset = this.ActualWidth + 20.0d;
                this.Animate("Opacity", 200, 0.0d);
                this.Animate("(RenderTransform).(TranslateTransform.X)", 200, -offset, (element) =>
                {
                    this.OnSwipeLeft();
                    this.Animate("(RenderTransform).(TranslateTransform.X)", 200, -offset, (element2) =>
                    {
                        transform   = (TranslateTransform)this.RenderTransform;
                        transform.X = offset;

                        this.Animate("Opacity", 200, 1.0d);
                        this.Animate("(RenderTransform).(TranslateTransform.X)", 250, 0.0d);
                    });
                });
            }
            else if (transform.X != 0.0d)
            {
                this.Animate("(RenderTransform).(TranslateTransform.X)", 300, 0.0d);
            }
        }
Beispiel #5
0
 private void OnGestureCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
     {
         /*var abs = Math.Abs(PANEL_DRAG_HORIZONTAL);
         if (abs > 75)
         {
             if (PANEL_DRAG_HORIZONTAL > 0)
                 MovePrevious();
             else
                 MoveNext();
             e.Handled = true;
         }*/
     }
 }
Beispiel #6
0
        private void OnDragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            string currentUrl = this.Browser.Browser.Source.OriginalString;

            if (string.IsNullOrEmpty(currentUrl) || !currentUrl.Contains("#") || currentUrl.Contains("login") || currentUrl.Contains("settings"))
            {
                e.Handled = false;
                return;
            }

            if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
            {
                ToggleMenu(null, null);
            }
        }
Beispiel #7
0
 private void GestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     if (uptansform.TranslateX == 0 || uptansform.TranslateX == 380)
         return;
     if (e.HorizontalChange < 0)
         //uptansform.TranslateX = 0;
         TranslateStory(uptansform.TranslateX, 0,TimeSpan.FromSeconds(0.3), null);
     else
     {
         if (uptansform.TranslateX < 120)
             TranslateStory(uptansform.TranslateX, 0, TimeSpan.FromSeconds(0.2), null);
         else
         TranslateStory(uptansform.TranslateX, 380, TimeSpan.FromSeconds(0.3), null);
     }
 }
        private void SwipeEventCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
            {
                if (Math.Abs(e.HorizontalChange) > 50)
                {

                    if (e.HorizontalChange > 0)
                    {
                        ShowPreviousChapter();
                    }
                    else
                    {
                        ShowNextChapter();
                    }
                }
            }
        }
Beispiel #9
0
        private void GestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalChange > 0 && !_isSettingsOpen)
            {
                if (e.HorizontalChange < _dragDistanceToOpen)
                    this.ResetLayoutRoot();
                else
                    this.OpenSettings();
            }

            if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalChange < 0 && _isSettingsOpen)
            {
                if (e.HorizontalChange > _dragDistanceNegative)
                    this.ResetLayoutRoot();
                else
                    this.CloseSettings();
            }
        }
        // Gesture - Drag is complete
        void gestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            // Left or Right
            if (e.HorizontalChange > 0)
            {
                // previous image (or last if first is shown)
                selectedPicture--;
                if (selectedPicture < 0) selectedPicture = city.Pictures.Length - 1;
            }
            else
            {
                // next image (or first if last is shown)
                selectedPicture++;
                if (selectedPicture > (city.Pictures.Length - 1)) selectedPicture = 0;
            }

            LoadImage();
        }
 // Drag is complete
 void gestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     if (e.HorizontalChange > 0)//L to R
     {
         global.selectedImageIndex--;//decrease idx
         if (global.selectedImageIndex < 0)//if first image reached
         {
             global.selectedImageIndex = global.galbumImages.Count - 1;//go to last image
         }
         LoadImage();
     }
     else
     {
         global.selectedImageIndex++;
         //first if last is shown
         if (global.selectedImageIndex > (global.galbumImages.Count - 1))
         {
             global.selectedImageIndex = 0;
         }
         LoadImage();
     }
 }
 private void gesture_DragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     message.Text = string.Format("drag completed with total change ({0},{1}) in the {2} direction ",
         e.HorizontalChange, e.VerticalChange, e.Direction, e.HorizontalVelocity, e.VerticalVelocity);
 }
Beispiel #13
0
 /// <summary>
 /// Déclenché lorsque l'utilisateur retire son doigt de l'imaga
 /// </summary>
 /// <param name="sender">Image sélectionnée par l'utilisateur</param>
 /// <param name="e"></param>
 private void GestureListener_OnDragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     _transform = null;
 }
        private void GestureListenerDragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            if (!isDragging) {
                EnableScroll();
                return;
            }

            isDragging = false;

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

            Canvas.SetZIndex(content, 0);

            OnEvent(DragStop);

            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;
        }
Beispiel #15
0
 private void GestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     double horizonChange = e.HorizontalChange;
     // horizonChange < 0 表示手向左滑
     if (horizonChange < -100)
     {
         DoGoNext();
     }
     else if (horizonChange > 100)
     {
         DoGoPrevios();
     }
 }
Beispiel #16
0
 private void OnDragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
 }
        private void listener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            if (e.Direction != Orientation.Vertical)
            {
                return;
            }

            IsPanning = false;
            IsStretching = false;

            e.Handled = true;
        }
 // Gesture - Drag is complete
 void gestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     // Left or Right
     if (e.HorizontalChange > 0)
     {
         // previous image (or last if first is shown)
         app.selectedImageIndex--;
         if (app.selectedImageIndex < 0)
         {
             app.selectedImageIndex = app.albumImages.Count - 1;
         }
     }
     else
     {
         // next image (or first if last is shown)
         app.selectedImageIndex++;
         if (app.selectedImageIndex > (app.albumImages.Count - 1))
         {
             app.selectedImageIndex = 0;
         }
     }
     // Load image from Google
     LoadImage();
 }
 private void myGridGestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     if (!UserFlick)
     {
         var topImg = Images.First(i => i.Item2.IsOnTop);
         while (!(Math.Abs(topImg.Item2.ImageShift) < 1))
         {
             if (topImg.Item2.ImageShift > 0)
             {
                 Images.ToList().ForEach(i => i.Item2.ImageShift--);
             }
             if (topImg.Item2.ImageShift < 0)
             {
                 Images.ToList().ForEach(i => i.Item2.ImageShift++);
             }
             Images.ToList().ForEach(i => i.Item1.RefreshSettings(i.Item2));
         }
     }
     UserFlick = false;
 }
 private void GestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     if ((ImageTransformation.ScaleX - 1.08) > 0 || (ImageTransformation.ScaleY - 1.08) > 0) return;
     var distance = firstPos.X - e.GetPosition(LayoutRoot).X;
     if (distance < -100)
     {
         FlipLeft();
     }
     else if (distance > 100)
     {
         FlipRight();
     }
 }
        private void GestureListener_OnDragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            if (e.Direction == Orientation.Horizontal) return;

            SelectedDate = e.VerticalChange > 0 ? SelectedDate.AddMonths(-1) : SelectedDate.AddMonths(1);
        }
 private void OnDragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     border.Background = normalBrush;
 }
Beispiel #23
0
        private void OnPushpinDragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            e.Handled = true;

            // Only react if there's a pushpin being dragged.
            var dragPushpinVm = _context.DragPushpin;
            if (dragPushpinVm == null)
            {
                return;
            }

            // Calculate the drop point to geo-coordinates.
            var point = DragPushpin.TransformToVisual(Map).Transform(new Point());
            point.X += DragPushpin.ActualWidth/2;
            point.Y += DragPushpin.ActualHeight;
            var location = Map.ViewportPointToLocation(point);
            _mapCenter.Value = location;
            dragPushpinVm.Data.Location = location.ToLocalLocation();

            // Select the dragged pushpin.
            _context.SelectedPushpin = dragPushpinVm;

            // Reset transformation of the drag cue.
            var transform = (CompositeTransform) DragPushpin.RenderTransform;
            transform.TranslateX = 0;
            transform.TranslateY = 0;

            // Unhook events.
            Map.MouseLeftButtonUp -= OnPushpinRelease;
            Map.MapPan -= OnCancelMapPan;

            // Update information for new location.
            _context.CommandUpdatePlace.ExecuteIfNotNull(dragPushpinVm);
        }
    /// <summary>
    /// Drag completed
    /// </summary>
    /// <param name="sender">Event sender</param>
    /// <param name="e">Event parameter</param>
    void GestureListener_DragCompleted(
            object sender,
            DragCompletedGestureEventArgs e)
    {
      Point offset = CalcOffsetToAlign(_mat);
      if (offset.X == 0)
        offset.X = e.HorizontalVelocity / 4;
      if (offset.Y == 0)
        offset.Y = e.VerticalVelocity / 4;

      if (offset.X == 0
        && offset.Y == 0)
        return;

      //
      // Compute offset again with final matrix.
      // If final matrix is not aligned,
      // let's make it align.
      // So the empty area should not be visible
      // as possible as it can.
      //
      var m = _mat;
      m.PostTranslate(offset.X, offset.Y);
      var testoffset = CalcOffsetToAlign(m);
      offset.X += testoffset.X;
      offset.Y += testoffset.Y;

      StartFlickAni(offset);
    }
        private void GestureListener_DragCompletedInput(object sender, DragCompletedGestureEventArgs e)
        {
            //if (marginLeft >= -400)
            //{
            //    Deployment.Current.Dispatcher.BeginInvoke(delegate
            //    {
            //        while (marginLeft < 0)
            //        {
            //            marginLeft++;

            //            Donationpop.Margin = new Thickness(0, marginLeft, 0, 0);
            //        }
            //    });
            //}
            //else
            //{
            //    Deployment.Current.Dispatcher.BeginInvoke(delegate
            //    {
            //        while (marginLeft > -800)
            //        {
            //            marginLeft--;

            //            Donationpop.Margin = new Thickness(0, marginLeft, 0, 0);
            //        }
            //    });
            //}
        }
Beispiel #26
0
        void RecoverDiag_DragEnd(object sender, DragCompletedGestureEventArgs e)
        {
            if (e.Direction == System.Windows.Controls.Orientation.Horizontal && e.HorizontalChange > 0)
            {
                // Nice, it was a flick which moved the dialog to the right. Now, let's see if the user moved it enough to hide it.
                var moveNeeded = 0.40; // 40% of the dialog must have been moved to the right.
                var actualMove = e.HorizontalChange / RecoverDialog.Width;

                if (actualMove >= moveNeeded)
                    HideResumePositionPrompt(false);
                else
                {
                    SbShowDialog.BeginTime = TimeSpan.FromSeconds(0);
                    SbShowDialog.Begin();
                }

                e.Handled = true;
            }
        }
Beispiel #27
0
 private void MapDragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     if (_mainViewModel.HeldUserPin == null)
     {
         return;
     }
     var pinP = _touchedPin.TransformToVisual(Map).Transform(new Point());
     pinP.Y += _touchedPin.RenderSize.Height;
     var p = _mainViewModel.HeldUserPin;
     var loc = Map.ViewportPointToLocation(pinP);
     p.Location = loc;
     var lngLat = new Location
     {
         Latitude = loc.Latitude,
         Longitude = loc.Longitude
     };
     var size = new Size {Width = 125, Height = 125};
     p.Image = GoogleMapsServices.GetStaticMap(lngLat, 15, size);
     p.Address = null;
     if (Globals.IsNetworkAvailable)
     {
         GoogleMapsServices.GetPlaceDetails(lngLat, places =>
         {
             if (places == null || places.Count() == 0)
             {
                 return;
             }
             p.Address = places.First().FormattedAddress;
         });
         p.Image = GoogleMapsServices.GetStaticMap(lngLat, 15, size);
     }
     var trans = (TranslateTransform) _touchedPin.RenderTransform;
     trans.X = trans.Y = default(double);
     _mainViewModel.HeldUserPin.IsMoving = false;
     _mainViewModel.HeldUserPin = null;
     _mainViewModel.EditingUserPin = (UserPin) _touchedPin.DataContext;
     _touchedPin = null;
     SurpassMapPan = false;
 }
 private void GestureListener_DragCompleted_1(object sender, DragCompletedGestureEventArgs e)
 {
     //MessageBox.Show("completed");
 }
Beispiel #29
0
 protected void ScrollViewer_DragCompleted(object sender, DragCompletedGestureEventArgs e)
 {
     if (e.Direction == System.Windows.Controls.Orientation.Horizontal)
     {
         if ((e.VerticalChange < 50) && (e.VerticalChange > -50))
         {
             if (e.HorizontalChange > 200)
             {
                 if (_topic.PrevPageUrl != null)
                 {
                     _url = _topic.PrevPageUrl;
                     LoadTopic(true);
                 }
                 else
                 {
                     NavigationService.GoBack();
                 }
             }
             else if (e.HorizontalChange < -200)
             {
                 if (_topic.NextPageUrl != null)
                 {
                     _url = _topic.NextPageUrl;
                     LoadTopic(true);
                 }
             }
         }
     }
 }
		private void GestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
		{
			var canvas = (Canvas)sender;
			var point = e.GetPosition(canvas);

			this.InvokePlaceLine(point);
		}
        static void listener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            ImageZoomerSettings settings;
             Image image = sender as Image;

             if (image == null)
            return;

             if (Images.TryGetValue(image, out settings))
             {
            if (settings.bounceOnNextComplete)
            {
               UpdateImagePosition(settings.bounceAmount, image, settings);
               settings.bounceOnNextComplete = false;
            }
             }
        }