Esempio n. 1
0
        /// <summary>
        /// Called before the ManipulationCompleted event occurs.
        /// </summary>
        protected override void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)
        {
            base.OnManipulationCompleted(e);

            if (e == null)
            {
                return;
            }

            this.NotifyManipulationCompleted(e);
            this.isInHold = false;

            this.manipulating = false;
        }
Esempio n. 2
0
 private void CurrentTrackPanel_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);
         }
     }
 }
Esempio n. 3
0
 private void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (_current != null)
     {
         if (_lastDeltaSign < 0)
         {
             this.AnimateNext(_current);
         }
         else
         {
             this.AnimatePrev(_current);
         }
     }
 }
Esempio n. 4
0
        private void Grid_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            if ((Math.Abs((MainGrid.RenderTransform as CompositeTransform).TranslateX) >= Window.Current.Bounds.Width / 3))
            {
                FirstOpen = false;
                ((DoubleAnimation)CloseAboutPage.Children[0]).To = Window.Current.Bounds.Width;
                CloseAboutPage.Begin();
            }

            else
            {
                OpenAboutPage.Begin();
            }
        }
Esempio n. 5
0
        void Page_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            try
            {
                grid_SwipeAction.Visibility = Visibility.Collapsed;

                if (TouchSwipingCompleted)
                {
                    ClosePopup();
                    TouchSwipingCompleted = false;
                }
            }
            catch { }
        }
Esempio n. 6
0
        /// <summary>
        /// Called before the ManipulationCompleted event occurs.
        /// </summary>
        /// <param name="e">Event data for the event.</param>
        protected override void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)
        {
            base.OnManipulationCompleted(e);

            if (e.Handled)
            {
                return;
            }

            if (e.PointerDeviceType == PointerDeviceType.Touch)
            {
                e.Handled = this.ActualController.HandleTouchCompleted(this, e.ToTouchEventArgs(this));
            }
        }
Esempio n. 7
0
 /// <summary>
 /// Slider Manipulation Completed
 /// </summary>
 /// <param name="sender">Slider</param>
 /// <param name="e">Manipulation Starting Routed Event Args</param>
 private void BindableSlider_ManipulationCompleted(object sender,
                                                   ManipulationCompletedRoutedEventArgs e)
 {
     if (_isStarted)
     {
         var slider = (Slider)sender;
         var value  = (int)slider.Value;
         if (ValueChangedCommand != null)
         {
             ValueChangedCommand.Execute(value);
         }
     }
     _isStarted = false;
 }
        /// <summary>
        /// Called when the <see cref="E:System.Windows.UIElement.ManipulationCompleted"/> event occurs.
        /// </summary>
        /// <param name="e">
        /// The data for the event.
        /// </param>
        public void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)
        {
            var p = new Point(e.Position.X + e.Cumulative.Translation.X, e.Position.Y + e.Cumulative.Translation.Y);

            if (this.manipulatorCount == 1)
            {
                this.rotateHandler.Completed(p);
            }

            if (this.manipulatorCount == 2)
            {
                this.panHandler.Completed(p);
                this.zoomHandler.Completed(p);
            }
        }
Esempio n. 9
0
        private void imgSingleMode_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            if (transformSingleModeImage.ScaleX > SingleModeImageScaleMax)
            {
                ScaleAnimation.ScaleTo(imgSingleMode, SingleModeImageScaleMax, SingleModeImageScaleMax, 200);
                transformSingleModeImageGhost.ScaleX = transformSingleModeImageGhost.ScaleY = SingleModeImageScaleMax;
            }
            else if (transformSingleModeImage.ScaleX < SingleModeImageScaleMin)
            {
                ScaleAnimation.ScaleTo(imgSingleMode, SingleModeImageScaleMin, SingleModeImageScaleMin, 200);
                transformSingleModeImageGhost.ScaleX = transformSingleModeImageGhost.ScaleY = SingleModeImageScaleMin;
            }

            App.CurrentInstance.OpertationPageChanged = true;
        }
Esempio n. 10
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;
                    }
                }
            }
        }
Esempio n. 11
0
 private async void Speed_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (IsPerformingWrite())
     {
     }
     else
     {
         speedValue = (UInt16)(Speed.Value);
         if (speedValue != lastSpeedValue)
         {
             await WriteAsyncCompressor();
         }
     }
     manipulating = false;
 }
Esempio n. 12
0
        private void TouchArea_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            Cursor.Margin           = InitialCursorMargin;
            CurrentValueText.Margin = InitialLabelMargin;
            DynamicBar.X2           = DynamicBar.X1;
            CurrentValueText.Text   = "";

            if (OnRelease != null)
            {
                OnRelease(this, new OnReleaseArgs()
                {
                    Value = (int)CurrentValue
                });
            }
        }
Esempio n. 13
0
        private void layoutRoot_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            var angleFromYAxis = 360 - Angle;

            SelectedItem = _pieSlices
                           .SingleOrDefault(p => p.StartAngle <= angleFromYAxis && (p.StartAngle + p.Angle) > angleFromYAxis);

            var finalAngle = SelectedItem.StartAngle + SelectedItem.Angle / 2;

            doubleAnimation.From = Angle;
            doubleAnimation.To   = 360 - finalAngle;
            storyBoard.Begin();

            Angle = 360 - finalAngle;
        }
        private void The_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            var vm = (BookContentPageViewModel)DataContext;

            //上一页(章节)
            if (x > 50)
            {
                SwithToPre();
            }
            // 下一页(章节)
            else if (x < -50)
            {
                SwitchToNext();
            }
        }
        private void Ellipse_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            var elli = (sender as Ellipse);

            var parent = elli.Parent as Panel;

            (parent.Background as SolidColorBrush).Opacity = 1.0;
            foreach (var child in parent.Children)
            {
                if (child != elli)
                {
                    child.Opacity = 1.0;
                }
            }
        }
Esempio n. 16
0
 private void Page_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (Math.Abs(distX) <= 3)
     {
         return;
     }
     if (distX > 0)
     {
         (DataContext as MoonDailyViewModel).BackwardCommand?.Execute(null);
     }
     else if (distX < 0)
     {
         (DataContext as MoonDailyViewModel).ForwardCommand?.Execute(null);
     }
 }
Esempio n. 17
0
        void OnManipulatedCompleted(object sender,
                                    ManipulationCompletedRoutedEventArgs e)
        {
            this.TranslateContent(0);

            if (IsManipulationSignificant(e.Cumulative.Translation.X))
            {
                SwipeEventArgs args = new SwipeEventArgs()
                {
                    Direction = e.Cumulative.Translation.X < 0 ?
                                SwipeDirection.Left : SwipeDirection.Right
                };
                this.Swiped?.Invoke(this, args);
            }
        }
Esempio n. 18
0
        public void Img_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            ((Image)sender).Opacity = 1;

            if (((CompositeTransform)((Image)sender).RenderTransform).TranslateX >= pila[((Image)sender).Name].TranslateX - 10 &&
                ((CompositeTransform)((Image)sender).RenderTransform).TranslateX <= pila[((Image)sender).Name].TranslateX + 10 &&
                ((CompositeTransform)((Image)sender).RenderTransform).TranslateY >= pila[((Image)sender).Name].TranslateY - 10 &&
                ((CompositeTransform)((Image)sender).RenderTransform).TranslateY <= pila[((Image)sender).Name].TranslateY + 10)
            {
                ((CompositeTransform)((Image)sender).RenderTransform).TranslateX = pila[((Image)sender).Name].TranslateX;
                ((CompositeTransform)((Image)sender).RenderTransform).TranslateY = pila[((Image)sender).Name].TranslateY;

                myRectangle.Visibility = Visibility.Visible;
            }
        }
Esempio n. 19
0
        private void B_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            Debug.WriteLine("Manipulation finish");
            _draging = false;
            ObservableCollection <LabelItem> itemsSource = ItemsSource as ObservableCollection <LabelItem>;
            var toRemove = (sender as Button).GetValue(LabelProperty) as LabelItem;

            itemsSource.Remove(toRemove);
            update();
            OnRemoveLabel?.Execute(new LabelListChangeEvent {
                label            = toRemove,
                LabelListControl = this,
                eventType        = LabelListChangeEvent.EventType.Remove
            });
        }
Esempio n. 20
0
        private void Image_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            Image         imgAux          = sender as Image;
            var           image_Transform = (CompositeTransform)imgAux.RenderTransform;
            InertialImage imagenActual    = images.Find(i => i.GetPosX() == image_Transform.TranslateX && i.GetPosY() == image_Transform.TranslateY);

            imagenActual.XInertia = imagenActual.YInertia = false;
            //If a player scores, the ball disapears
            //Since you cannot remove the ball dynamically from the grid, we set opacity to 0
            if (imagenActual.isGoal)
            {
                images.Remove(imagenActual);
                imagenActual.GetImage().Opacity = 0;
            }
        }
Esempio n. 21
0
        private void EffectLine_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            _isPressed = false;
            m_ScrollTimerClock.Stop();
            LayerPage.Self.UpdateSupportLine(-1);

            if (elvm.Layer.ExceedIfApplyingEff(elvm))
            {
                if (mouseState == CursorState.SizeAll)
                {
                    EffectLeft = _undoValue;
                }
                else if (mouseState == CursorState.SizeLeft)
                {
                    double diff = _undoValue - EffectLeft;
                    EffectLeft   = _undoValue;
                    EffectWidth -= diff;
                }
                else if (mouseState == CursorState.SizeRight)
                {
                    EffectWidth = _undoValue;
                }

                // TODO : Show Dialog
            }
            else
            {
                double result     = elvm.Layer.ApplyEffect(elvm);
                var    containter = FindParentDependencyObject(this);
                containter.SetValue(Canvas.ZIndexProperty, 0);

                if (mouseState == CursorState.SizeAll)
                {
                    ReUndoManager.Store(new MoveEffectCommand(elvm, _undoValue, result));
                }
                else if (mouseState == CursorState.SizeLeft)
                {
                    ReUndoManager.Store(new WidthLeftEffectCommand(elvm, _undoValue, EffectLeft));
                }
                else if (mouseState == CursorState.SizeRight)
                {
                    ReUndoManager.Store(new WidthRightEffectCommand(elvm, _undoValue, EffectWidth));
                }
            }

            mouseState   = CursorState.None;
            this.Opacity = 1;
        }
Esempio n. 22
0
        private void LaunchPokeballButton_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            GameClient.CurrentSession.Logger.Debug("Manipulation Completed...");

            // Disable the pokeball so that we can't try and throw it again
            ViewModel.PokeballButtonEnabled = false;

            var EndingX = (float)PokeballTransform.TranslateX;
            var EndingY = (float)PokeballTransform.TranslateY;

            // Pull out of the history where our finger was ~300ms ago
            var start     = PastPositions.Peek();
            var startTime = start.Item2;
            var startPos  = start.Item1;

            // TODO: Use PastPositions to determine if this is a curve ball, and if it is
            // apply a force in the direction of the curve

            // Get some details that we will need to do math with
            var displacement   = new Vector2(EndingX - startPos.X, EndingY - startPos.Y);
            var distance       = displacement.Length();
            var throwDirection = Vector3.Normalize(new Vector3(displacement.X, displacement.Y, 100.0f));
            var timeDelta      = (DateTime.Now - startTime).Milliseconds;

            // Set our initial position and velocity in world space
            ThrowItemPosition = new Vector3(EndingX, EndingY, 0);
            ThrowItemVelocity = distance * 100.0f / timeDelta * throwDirection;
            // Cutoff to prevent wasting balls when you didn't actually throw them
            if (ThrowItemVelocity.LengthSquared() < 100)
            {
                PokeballTransform.TranslateX    = InitItemX;
                PokeballTransform.TranslateY    = InitItemY;
                PokeballTransform.ScaleX        = 1;
                PokeballTransform.ScaleY        = 1;
                ViewModel.PokeballButtonEnabled = true;
                return;
            }

            /*
             * Logger.Write("Init throwDirection " + throwDirection.X + ", " + throwDirection.X + ", " + throwDirection.Z);
             * Logger.Write("Init TimeDelta " + timeDelta);
             * Logger.Write("Init Position " + ThrowItemPosition.X + ", " + ThrowItemPosition.Y + ", " + ThrowItemPosition.Z);
             * Logger.Write("Init Velocity " + ThrowItemVelocity.X + ", " + ThrowItemVelocity.Y + ", " + ThrowItemVelocity.Z);
             */

            prevTime = DateTime.Now;
            ThreadPoolTimer.CreatePeriodicTimer(PokeballUpdateLoop, TimeSpan.FromMilliseconds(20));
        }
        private void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs args)
        {
            if (_currentStroke == null)
            {
                return;
            }

            if (CurrentDrawingMode == DrawingMode.Moving)
            {
                CurrentDrawingMode = DrawingMode.Selection;
            }

            _strokes.Push(_currentStroke);
            _currentStroke = null;
            _canvasControl.Invalidate();
        }
Esempio n. 24
0
 private void bodyGrid_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (transitionInProcess)
     {
         return;
     }
     dragging = false;
     if (e.Cumulative.Translation.X > 0)
     {
         FlipTransition(false);
     }
     else
     {
         FlipTransition(true);
     }
 }
Esempio n. 25
0
        public static void FillAnimation(this ManipulationCompletedRoutedEventArgs e, double fullDimension,
                                         Action forward, Action backward,
                                         AnimationAxis orientation = AnimationAxis.Y, double ratio = 0.5)
        {
            var translation = e.Cumulative.Translation;
            var distance    = orientation == AnimationAxis.X ? translation.X : translation.Y;

            if (distance >= fullDimension * ratio)
            {
                forward();
            }
            else
            {
                backward();
            }
        }
Esempio n. 26
0
 private void CustomAppBarRoot_OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     // if small appbar-position changes are made app bar should back to previous position, just like in windows phone
     if (Math.Abs(e.Cumulative.Translation.Y) < 20)
     {
         isAppBarShown = !isAppBarShown;
     }
     if (!isAppBarShown)
     {
         ShowCustomAppBar();
     }
     else
     {
         HideCustomAppBar();
     }
 }
Esempio n. 27
0
        private async void _popup_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            var Host = (FrameworkElement)this.Parent;
            var y    = e.Position.Y;

            if (e.Cumulative.Translation.Y > 50)
            {
                (HidePopupStoryboard.Children[0] as DoubleAnimation).To = Host.ActualHeight;
                (HidePopupStoryboard.Children[1] as DoubleAnimation).To = 0;
                await HidePopupStoryboard.BeginAsync();
            }
            else
            {
                await ShowPopupStoryboard.BeginAsync();
            }
        }
Esempio n. 28
0
        protected override void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)
        {
            var oldDirection = Config.Direction;
            var swipeRate    = e.Cumulative.Translation.X / ActualWidth * Config.SwipeLengthRate;

            _swipeAnimationConstructor.Config.CurrentSwipeWidth = Math.Abs(_mainLayerTransform.X);

            _swipeAnimationConstructor.DisplaySwipeAnimation(oldDirection,
                                                             (easingFunc, itemToX, duration) => ReleaseAnimationBeginTrigger(oldDirection, easingFunc, itemToX, duration),
                                                             () => ReleaseAnimationTriggerComplete(oldDirection),
                                                             (easingFunc, itemToX, duration) => ReleaseAnimationBeginRestore(oldDirection, easingFunc, itemToX, duration),
                                                             () => ReleaseAnimationRestoreComplete(oldDirection)
                                                             );

            Config.Direction = SwipeDirection.None;
        }
Esempio n. 29
0
 void gridMain_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (e.Cumulative.Translation.Y > 0 && !isopen)
     {
         isopen = false;
     }
     if (e.Cumulative.Translation.Y < 0 && isopen)
     {
         isopen = true;
     }
     if (e.Cumulative.Translation.Y == 0)
     {
         return;
     }
     animate();
 }
Esempio n. 30
0
        private void LOReaderView_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
        {
            if (_pointers > 1)
            {
                /*if (_ismanipulationenable && _elementslist[_currentindex].IsLoaded)
                 *  if (LOReaderAnimate2Thumbnail != null)
                 *      LOReaderAnimate2Thumbnail(this);*/
            }
            else
            {
                if (Math.Abs(e.Velocities.Linear.X) > 3.5)
                {
                    if (e.Velocities.Linear.X > 0)
                    {
                        _currentindex -= 1;
                    }
                    else
                    {
                        _currentindex += 1;
                    }
                }
                else
                {
                    if (_currentposition < -1.0 * (DeviceWidth * _currentindex + DeviceWidth / 2.0))
                    {
                        _currentindex += 1;
                    }

                    if (_currentposition > -1.0 * (DeviceWidth * _currentindex - DeviceWidth / 2.0))
                    {
                        _currentindex -= 1;
                    }
                }
                animate2index(_currentindex);
            }

            _pointers = 0;
            _forcemanipulation2end = false;
            _maniuplation_done     = false;
            _deltatested           = false;
            is_horizontal          = false;
            is_vertical            = false;
            if (!_islocked)
            {
                _ismanipulationenable = true;
            }
        }
Esempio n. 31
0
 public virtual void OnManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     if (ManipulationCompleted != null) ManipulationCompleted(sender, e);
 }
Esempio n. 32
0
        /// <summary>
        /// Called before the ManipulationCompleted event occurs.
        /// </summary>
        /// <param name="e">Event data for the event.</param>
        protected override void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)
        {
            base.OnManipulationCompleted(e);

            if (e.Handled)
            {
                return;
            }

            if (e.PointerDeviceType == PointerDeviceType.Touch)
            {
                e.Handled = this.ActualController.HandleTouchCompleted(this, e.ToTouchEventArgs(this));
            }
        }