Наследование: RoutedEventArgs, IManipulationCompletedRoutedEventArgs
        private void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            Debug.WriteLine("OnManipulationCompleted");
            if (_completed)
                return;

            try
            {
                if (!_deltaDetected && (DateTime.Now - _startTime).TotalSeconds < 0.5)
                {
                    //                    if (!_tapHandled)
                    //                        this.InvokeTapEvent();
                }
                else
                {
                    EventHandler<ManipulationCompletedRoutedEventArgs> eventHandler = Completed;
                    if (eventHandler == null)
                        return;
                    eventHandler(sender, e);
                }
            }
            finally
            {
                _completed = true;
            }
        }
Пример #2
0
 private void SplitViewOpener_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (e.Cumulative.Translation.X > 50)
     {
         MySplitView.IsPaneOpen = true;
     }
 }
Пример #3
0
 private void OnSplitViewPaneManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (e.Cumulative.Translation.X < -50)
     {
         SplitViewMenu.IsPaneOpen = false;
     }
 }
Пример #4
0
 void Manipulation_Completed(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     endX = e.Position.X;
     if (endX < startX)
         Frame.Navigate(typeof (GetStarted2));
     e.Handled = true;
 }
		private void Border_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
		{
			translation = 0;
			translationFactor = 0;
			translationTransform.Y = 0;
			timer.Stop();
		}
Пример #6
0
        private void EndSwipe(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            endPosition = e.Position.X;
            verticalEndPosition = e.Position.Y;

            if ((startPosition > endPosition) && ((startPosition - endPosition) > 40))
            {
                Frame.Navigate(typeof(slide2));
            }
            if ((startPosition < endPosition) && ((endPosition - startPosition) > 40))
            {
                Frame.GoBack();
            }

            if ((verticalStartPosition > verticalEndPosition) && ((verticalStartPosition - verticalEndPosition) > 40))
            {
                //Parallel Translation
                swipeTranslation(ApplicationData.Current.RoamingSettings.Values["parallel"].ToString());
            }
            if ((verticalStartPosition < verticalEndPosition) && ((verticalEndPosition - verticalStartPosition) > 40))
            {
                //Primary Translation
                swipeTranslation(ApplicationData.Current.RoamingSettings.Values["primary"].ToString());
            }
        }
        /// <summary>
        /// Called when a manipulation is complete.
        /// </summary>
        /// <remarks>
        /// If the manipulation isn't more than half the object width, then the position is reset,
        /// otherwise the direction is picked and the animation switched forward or backwards by a
        /// frame, the underlying objects are updated to complete the illusion.
        /// </remarks>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="ManipulationCompletedRoutedEventArgs"/> instance containing the event data.</param>
        private void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs args)
        {
            var from = args.Cumulative.Translation.X;

            var absX = Math.Abs(args.Cumulative.Translation.X);
            if (absX < this.Root.ActualWidth / 2)
            {
                // no transition, just animate back from the current location.
            }
            else if (args.Cumulative.Translation.X > 0)
            {
                // swiping right - move to previous
                from -= this.Root.ActualWidth;
                this.ImageSet.MoveToPreviousImage();
            }
            else
            {
                // swiping left - move to next
                from += this.Root.ActualWidth;
                this.ImageSet.MoveToNextImage();
            }

            this.AnimateToZero(from);
            args.Handled = true;
        }
        private void CenterGrid_ManipulateCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            double deltaX = TouchDownX - e.Position.X;
            double deltaY = TouchDownY - e.Position.Y;

            double absX = Math.Abs(TouchDownX - e.Position.X);
            double absY = Math.Abs(TouchDownY - e.Position.Y);

            if (absX > absY) //left or right
            {
                if (deltaX > 0 & deltaX > 12) //right
                {
                    ((StudyFlashCardSetViewModel) ViewModel).FlipCardRightCommand.Execute(null);
                }
                else if (deltaX < -12) //left
                {
                    ((StudyFlashCardSetViewModel) ViewModel).FlipCardLeftCommand.Execute(null);
                }
            }
            else // up or down
            {
                if (deltaY> 0 & deltaY > 12) //up
                {
                    ((StudyFlashCardSetViewModel) ViewModel).CorrectNextCardCommand.Execute(null);
                }
                else if (deltaY < -12) //down
                {
                    ((StudyFlashCardSetViewModel) ViewModel).IncorrectNextCardCommand.Execute(null);
                }
            }
        }
Пример #9
0
        private void VEManipulationEndX( object sender, ManipulationCompletedRoutedEventArgs e )
        {
            double dv = e.Cumulative.Translation.X.Clamp( MinVT, MaxVT );
            ContentAway?.Stop();
            if ( VT < dv )
            {
                ContentAway = new Storyboard();
                SimpleStory.DoubleAnimation(
                    ContentAway, CGTransform, "TranslateX"
                    , CGTransform.TranslateX
                    , MainSplitView.ActualWidth );

                ContentBeginAwayX( false );
            }
            else if ( dv < -VT )
            {
                ContentAway = new Storyboard();
                SimpleStory.DoubleAnimation(
                    ContentAway, CGTransform, "TranslateX"
                    , CGTransform.TranslateX
                    , -MainSplitView.ActualWidth );

                ContentBeginAwayX( true );
            }
            else
            {
                ContentRestore.Begin();
            }
        }
 private void HypothesesView_ManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
 {
     //var moveIndexBy = -Math.Floor(e.Cumulative.Translation.Y/(HypothesisViewModel.DefaultSize + GAP));
     //_lastVisibleIndex += (int) moveIndexBy;
     //updateRendering();
     updateRendering();
 }
Пример #11
0
        private void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            if (_direction > 0 && this.Position >= 0)
            {
                e.Handled = true;
                return;
            }

            if (_direction < 0 && this.Position <= -(this.ItemWidth * _panel.ItemsCount - this.ActualWidth))
            {
                e.Handled = true;
                return;
            }

            if (_direction > 0)
            {
                _panel.TranslateDeltaX(0.01);
                AnimatePrev();
            }
            else
            {
                _panel.TranslateDeltaX(-0.01);
                AnimateNext();
            }
            e.Handled = true;
        }
Пример #12
0
 protected override void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)
 {
     base.OnManipulationCompleted(e);
     if (Action != null)
     {
         Action.OnManipulationCompleted(e);
     }
 }
Пример #13
0
 public void ToDiaryIfSwipedLeft(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     var currentPoint = e.Position;
     if (_initialPoint.X - currentPoint.X >= Constants.SWIPING_TRESHOLD)
     {
         NavigateToDiary();
     }
 }
Пример #14
0
 public void RandomKuva_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (_transformImage.X > 80 || _transformImage.X < -80)
     {
           vm.RandomKuva_ManipulationCompleted();
     }
     _transformImage.X = 0;
 }
 private void Colors_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     var angle = rotateColors.Angle;
     angle += (e.Cumulative.Rotation > 0) ? 90 : 270;
     angle = angle % 360;
     rotateColors.Angle = angle;
     Colors.RenderTransform = rotateColors;
 }
Пример #16
0
 private void GridLayout_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     var velocity = e.Velocities;
     if (velocity.Linear.Y - velocity.Linear.X > 0.4)
     {
         this.Frame.Navigate(typeof(Views.Menu));
     }
 }
Пример #17
0
        private void MainContent_ManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
        {
            if (this.shouldAnimate)
            {
                double cumulativeTranslation = 0;
                double animationDistance     = 0;
                switch (this.DrawerLocation)
                {
                case DrawerLocation.Left:
                    cumulativeTranslation = e.Cumulative.Translation.X;
                    animationDistance     = this.drawer.Width;
                    break;

                case DrawerLocation.Right:
                    cumulativeTranslation = -e.Cumulative.Translation.X;
                    animationDistance     = this.drawer.Width;
                    break;

                case DrawerLocation.Top:
                    cumulativeTranslation = e.Cumulative.Translation.Y;
                    animationDistance     = this.drawer.Height;
                    break;

                case DrawerLocation.Bottom:
                    cumulativeTranslation = -e.Cumulative.Translation.Y;
                    animationDistance     = this.drawer.Height;
                    break;
                }

                var offset = (cumulativeTranslation / animationDistance) * this.AnimationDuration.TimeSpan.Milliseconds;

                if (cumulativeTranslation > animationDistance / 3)
                {
                    this.Context.MainContentStoryBoard.Resume();
                    this.Context.DrawerStoryBoard.Resume();

                    this.IsOpen = true;
                }
                else
                {
                    this.Context.MainContentStoryBoardReverse.Begin();
                    this.Context.MainContentStoryBoardReverse.Pause();
                    this.Context.DrawerStoryBoardReverse.Begin();
                    this.Context.DrawerStoryBoardReverse.Pause();

                    this.Context.MainContentStoryBoardReverse.Seek(TimeSpan.FromMilliseconds(this.AnimationDuration.TimeSpan.Milliseconds - offset));
                    this.Context.DrawerStoryBoardReverse.Seek(TimeSpan.FromMilliseconds(this.AnimationDuration.TimeSpan.Milliseconds - offset));

                    this.Context.MainContentStoryBoardReverse.Resume();
                    this.Context.DrawerStoryBoardReverse.Resume();

                    this.IsOpen = false;
                }

                this.shouldAnimate = false;
            }
        }
        protected override void ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            double totalManipulation = (e.Position.X + e.Velocities.Linear.X/20);
            FlipDirection flipDirection = totalManipulation > DRAG_THRESHOLD
                ? FlipDirection.Backward
                : totalManipulation < -DRAG_THRESHOLD ? FlipDirection.Forward : FlipDirection.Revert;

            DoFlip(flipDirection);
        }
 private void OnManipulationCompleted(object sender,
     ManipulationCompletedRoutedEventArgs manipulationCompletedRoutedEventArgs)
 {
     IsScrolling = false;
     if (_numTouchPoints <= 1)
     {
         ManipulationDelta -= OnDelta;
     }
 }
Пример #20
0
        private void ScrollLongDescrition_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            var sc = sender as ScrollViewer;

            if (sc.ViewportHeight == sc.ExtentHeight)
                GradientText.Visibility = Visibility.Collapsed;
            else
                GradientText.Visibility = Visibility.Visible;
        }
Пример #21
0
 private void SplitViewPane_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (e.Cumulative.Translation.X < -40)
     {
         
         MySplitView.IsPaneOpen = false;
         
     }
 }
Пример #22
0
 void Manipulation_Completed(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     endX = e.Position.X;
     if (endX < startX) //forward
         Frame.Navigate(typeof (GetStarted5));
     else if (endX > startX) //back
         Frame.Navigate(typeof (GetStarted3));
     e.Handled = true;
 }
Пример #23
0
 private void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (_direction > 0)
     {
         MoveBack();
     }
     else
     {
         MoveForward();
     }
 }
Пример #24
0
 void LayoutViewKnowLedge_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     var velocity = e.Velocities;
     if (velocity.Linear.X < -0.4)
     {
         NextView();
     }
     if (velocity.Linear.X > 0.4)
     {
         BackView();
     }
 }
        protected override void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)
        {
            base.OnManipulationCompleted(e);

            if (saveTile == null)
                return;
            double offsetX = (e.Position.X - StartPoint.X);
            double offsetY = (e.Position.Y - StartPoint.Y);
            var radians = Math.Atan2(offsetY, offsetX);
            var angle = radians * (180 / Math.PI) + 180;
            var l = Math.Sqrt(Math.Pow(offsetX, 2) + Math.Pow(offsetY, 2));
            if (l >= 5)
            {
                if ((angle >= 0 && angle <= 20) || (angle <= 360 && angle >= 340))
                {
                    if (FindTile(saveTile.IndexX - 1, saveTile.IndexY, saveTile) != null)
                    {
                        saveTile.IndexX -= 1;
                        FindTile(saveTile.IndexX, saveTile.IndexY, saveTile).IndexX += 1;
                    }
                }
                else
                    if (angle >= 70 && angle <= 110)
                {
                    if (FindTile(saveTile.IndexX, saveTile.IndexY - 1, saveTile) != null)
                    {
                        saveTile.IndexY -= 1;
                        FindTile(saveTile.IndexX, saveTile.IndexY, saveTile).IndexY += 1;
                    }
                }
                else
                        if (angle >= 160 && angle <= 200)
                {
                    if (FindTile(saveTile.IndexX + 1, saveTile.IndexY, saveTile) != null)
                    {
                        saveTile.IndexX += 1;
                        FindTile(saveTile.IndexX, saveTile.IndexY, saveTile).IndexX -= 1;
                    }
                }
                else
                            if (angle >= 250 && angle <= 290)
                {
                    if (FindTile(saveTile.IndexX, saveTile.IndexY + 1, saveTile) != null)
                    {
                        saveTile.IndexY += 1;
                        FindTile(saveTile.IndexX, saveTile.IndexY, saveTile).IndexY -= 1;
                    }
                }
            }
            saveTile = null;
        }
Пример #26
0
 private void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (_current != null)
     {
         if (_lastDeltaSign < 0)
         {
             this.AnimateNext(_current);
         }
         else
         {
             this.AnimatePrev(_current);
         }
     }
 }
Пример #27
0
 private void Rectangle_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (Math.Abs(e.Cumulative.Translation.Y) < 10)
     {
         if (e.Cumulative.Translation.X > 30 && LibraryViewModel.Current.PlayQueue.PrevPlayer.CanExecute(null))
         {
             LibraryViewModel.Current.PlayQueue.PrevPlayer.Execute(null);
         }
         else if (e.Cumulative.Translation.X < -30 && LibraryViewModel.Current.PlayQueue.SkipPlayer.CanExecute(null))
         {
             LibraryViewModel.Current.PlayQueue.SkipPlayer.Execute(null);
         }
     }
 }
Пример #28
0
 private static void CustomHamburgerMenu_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     var ctrl = sender as HamburgerMenu;
     if (ctrl != null)
     {
         if (ctrl.LeftPane != null)
         {
             if (isPanMovementLargerThen(e, ctrl, Window.Current.Bounds.Width * 0.2))
             {
                 ctrl.IsLeftPaneOpen = false;
             }
         }
     }
 }
Пример #29
0
 private new void ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     var trans = e.Cumulative.Translation;
     double DeltaX = Math.Abs(trans.X);
     if (Math.Abs(trans.Y) * 1.2 < DeltaX && DeltaX > 50)
     {
         if (trans.X > 0)
         {
             navAnimate.Edge = EdgeTransitionLocation.Right;
             edge = navAnimate.Edge;
             this.Frame.Navigate(typeof(MainPage));
         }
     }
 }
        private bool HandleManipulationCompleted(Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
        {
            Point velocity = e.Velocities.Linear;

            if (velocity.X != 0 || velocity.Y != 0)
            {
                return(this.HandleGesture(new FlickGesture()
                {
                    Position = this.primaryTouchPoint, Velocity = velocity
                }));
            }

            return(false);
        }
Пример #31
0
        private void tab_Keyboard_ManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
        {
            try
            {
                double CurrentPointHorizontal    = e.Position.X;
                double CurrentVerticalDifference = Math.Abs(e.Position.Y - TouchStartingPoint.Y);

                //From the left to right
                if (CurrentVerticalDifference < TouchSwipingLimitHeight && CurrentPointHorizontal - TouchStartingPoint.X > TouchSwipingRange)
                {
                    KeyboardSwitch();
                }
            }
            catch { }
        }
        private void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {

            if (_isPaused)
                return;

            e.Handled = true;

            if (_skipNextEvent)
            {
                _skipNextEvent = false;
                return;
            }

            // Tap
            if (e.IsInertial)
            {
                if ((_mode & FlippingMode.Touch) == FlippingMode.Touch)
                {
                    var transform = (e.OriginalSource as FrameworkElement).TransformToVisual(_bookView);
                    var localControlPoint = e.Position;
                    var point = transform.TransformPoint(localControlPoint);
                    if (point.X > Screen.Width/2)
                    {
                        if (!IsLastPage)
                        {
                            UpdateLayers(FlipDirection.Forward);
                            DoFlip(FlipDirection.Forward);
                        }
                    }
                    else
                    {
                        if (!IsFirstPage)
                        {
                            UpdateLayers(FlipDirection.Backward);
                            DoFlip(FlipDirection.Backward);
                        }
                    }
                }
            }
            else
            {
                if ((_mode & FlippingMode.Slide) == FlippingMode.Slide)
                {
                    ManipulationCompleted(sender, e);
                }
            }
        }
Пример #33
0
        private void HandlePlayerControlProgressBarBezzelManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            double newWidth = e.Position.X;

            if (newWidth < 0) newWidth = 0;
            if (newWidth > PlayerControlProgressBarFull.ActualWidth) newWidth = PlayerControlProgressBarFull.ActualWidth;

            PlayerControlProgressBarCompleted.Width = newWidth;

            double percentage = newWidth / PlayerControlProgressBarFull.ActualWidth;

            LibraryViewModel.Current.PlayQueue.ScrubToPercentage(percentage);

            ProgressBarScrubView.Visibility = Visibility.Collapsed;

            PlayerControlProgressBarCompleted.SetBinding(Rectangle.WidthProperty, savedWidthBinding);
            savedWidthBinding = null;

            PlayerControlText.Text = string.Empty;
        }
Пример #34
0
        private void Border_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            //if(Math.Abs(transformD.Rotation) < 10)
            //{
            //    DoubleAnimation animation = new DoubleAnimation();
            //    animation.From = transformD.Rotation;
            //    animation.To = 0;
            //    animation.Duration = TimeSpan.FromMilliseconds(400);
            //    QuadraticEase ease = new QuadraticEase();
            //    ease.EasingMode = EasingMode.EaseOut;
            //    animation.EasingFunction = ease;

            //    Storyboard storyboard = new Storyboard();
            //    Storyboard.SetTarget(animation, transformD);
            //    Storyboard.SetTargetProperty(animation, "Rotation");
            //    storyboard.Children.Add(animation);
            //    storyboard.Begin();
            //}
            //else
            //{
            //    UpperCardRT.IsHitTestVisible = false;
            //    UnderCardRT.IsHitTestVisible = false;

            //    //TODO Animate the card to left or right depend on the current position, maximum 200
            //    DoubleAnimation animation = new DoubleAnimation();
            //    animation.From = transformD.Rotation;
            //    animation.To = transformD.Rotation > 0 ? 90 : -90;
            //    animation.Duration = TimeSpan.FromMilliseconds(400);
            //    QuadraticEase ease = new QuadraticEase();
            //    ease.EasingMode = EasingMode.EaseOut;
            //    animation.EasingFunction = ease;

            //    Storyboard storyboard = new Storyboard();
            //    Storyboard.SetTarget(animation, transformD);
            //    Storyboard.SetTargetProperty(animation, "Rotation");
            //    storyboard.Children.Add(animation);
            //    storyboard.Completed += Storyboard_Completed;
            //    storyboard.Begin();

            //}
        }
        private void OnManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
        {
            if (!this.manipulating)
            {
                // If manipulating is false this means
                // that manipulation completed is called without ever
                // starting the manipulation.
                // For example if a gesture behavior is created after the manipulation over an
                // element has started, it will not receive the started event, but will
                // receive the completed event.
                return;
            }

            if (this.NotifyGestureCompleting != null)
            {
                this.NotifyGestureCompleting(this.lastGesture);
            }

            this.manipulating = false;
            if (this.gestureHandled || !this.CheckForHandled || !e.Handled)
            {
                e.Handled = this.HandleManipulationCompleted(e) || this.gestureHandled;
            }

            this.isInHold = false;

            if (this.NotifyGestureComplete != null)
            {
                this.NotifyGestureComplete(this.lastGesture);
            }

            this.gestureHandled        = false;
            this.manipulationContainer = null;
            this.originalSource        = null;
            this.lastGesture           = null;
        }
Пример #36
0
        async void ManipulateMe_ManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
        {
            try
            {
                Point point            = new Point(e.Position.X, e.Position.Y);
                Point transformedPoint = _transform.TransformPoint(point);

                if (_transform.Rotation > 360)
                {
                    _transform.Rotation -= 360;
                }
                else if (_transform.Rotation < -360)
                {
                    _transform.Rotation += 360;
                }



                Controller.CancelDirectManipulations();
            }
            catch (Exception ex)
            {
            }
        }
Пример #37
0
 private void RefreshLoadPanel_ManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
 {
     _isPressed = false;
 }
Пример #38
0
 private void Page_ManipulationCompleted_1(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
 {
     // TODO: Add event handler implementation here.
 }
Пример #39
0
 private void Image_ManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
 {
 }
Пример #40
0
 protected override void OnManipulationCompleted(Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
 {
     e.Handled = true;
     base.OnManipulationCompleted(e);
 }
 private void Control_ManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e)
 {
     Element.Complete();
     Control?.Invalidate();
 }