void MenuContent_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (e.FinalVelocities.LinearVelocity.Y < -500) { Storyboard6.Begin(); } }
private void HandleManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { sender.AsOption <UIElement>().Do( element => { var modifier = GetMostRepresentativeNumberOfTouchPoints(_gestureSurfaceTouchRegistry[element]) .Map(ToGestureModifier); var totalTranslation = e.TotalManipulation.Translation; var finalLinearVelocity = e.FinalVelocities.LinearVelocity; var observers = _observersOfElement[element]; var observersPairedWithGesture = observers.Select( o => new { Observer = o, Gesture = ToSwipeGesture(totalTranslation, finalLinearVelocity, o.UseVelocityForTapDetection, o.TapThreshold), Modifier = modifier }); foreach (var observerWithGesture in observersPairedWithGesture) { observerWithGesture.Observer.OnGestureDetected(observerWithGesture.Gesture, observerWithGesture.Modifier); } }); }
/** ManCompleteReaction * * Called when the Manipulation/move event is completed. * */ public void ManCompleteReaction(ManipulationCompletedEventArgs args) { StateMachine.State state = StateMachine.Instance.state; switch (state) { case StateMachine.State.Calibration: CaliMan c = this as CaliMan; if (c != null) { c.ManComplete(args); } break; case StateMachine.State.Interaction: InterMan i = this as InterMan; if (i != null) { i.ManComplete(args); } break; case StateMachine.State.Adjusting: AdjMan a = this as AdjMan; if (a != null) { a.ManComplete(args); } break; default: Debug.Log("Unkonwn State"); break; } }
private void dragInterceptor_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (this.dragItem == null) { this.scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Visible; } else { e.Handled = true; this._isManipulating = false; if (this.dropTargetIndex >= 0) { this.MoveItem(this.dragItem, this.dropTargetIndex); } if (this.dragItemContainer != null) { this.dragItemContainer.Visibility = Visibility.Visible; this.dragItemContainer.Opacity = 0.0; this.AnimateDrop(this.dragItemContainer); this.dragItemContainer = (ReorderListBoxItem)null; } this.dragScrollDelta = 0.0; this.dropTargetIndex = -1; this.ClearDropTarget(); this.scrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Visible; } }
private void Image_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (this.dragImage != null && this.isMoveToy) { e.Handled = true; } }
private void UiElementOnManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { var gesture = gestureRecognizer.Gesture; if (isDoubleTapping && Math.Abs(e.TotalManipulation.Translation.X) < 0.02) { PinchAction?.Invoke(); } else if (gesture == TouchGestureType.MoveRightToLeft) { SwipeLeftAction?.Invoke(); } else if (gesture == TouchGestureType.MoveLeftToRight) { SwipeRightAction?.Invoke(); } else if (gesture == TouchGestureType.MoveBottomToUp) { SwipeUpAction?.Invoke(); } else if (gesture == TouchGestureType.MoveTopToBottom) { SwipeDownAction?.Invoke(); } else if (gesture == TouchGestureType.SingleTap) { SingleTapAction?.Invoke(); } }
private void _menuCallout_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (!this.CheckShouldRespondToManipulation()) { return; } if (e.OriginalSource == this._menuCallout) { e.Handled = true; } this._manipulationStarted = false; Point point; double num1; if (e.FinalVelocities != null) { point = e.FinalVelocities.LinearVelocity; num1 = point.X; } else { num1 = 0.0; } double num2 = num1; point = e.TotalManipulation.Translation; double x = point.X; this.OpenCloseMenu(!this.IsMenuOpen ? x >= 216.0 || num2 >= 10.0 : x > -216.0 && num2 > -10.0, null, false); }
private void Element_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (!IsActive) { return; } FrameworkElement fe = sender as FrameworkElement; if (Math.Abs(e.TotalManipulation.Translation.X) > fe.ActualWidth / 2 || Math.Abs(e.FinalVelocities.LinearVelocity.X) > FlickVelocity) { if (e.TotalManipulation.Translation.X < 0.0) { ToDoItemDeletedAction(fe); } else { ToDoItemCompletedAction(fe); } } else { ToDoItemBounceBack(fe, null); } IsActive = false; }
private void LB_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (_isBouncy) { _isBouncy = false; } }
protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e) { tbCompleted.Text = string.Format("{0}", e.FinalVelocities.LinearVelocity); tbCompleted.Text += string.Format("\r\n{0}", e.TotalManipulation.Translation); //UIElement el = e.Source as UIElement; //el.Effect = new BlurEffect() { Radius= 10.0}; //MatrixTransform xform = el.RenderTransform as MatrixTransform; //Matrix matrix = xform.Matrix; //Matrix from = matrix; //Matrix to = matrix; //to.Translate(e.TotalManipulation.Translation.X * Math.Abs(e.FinalVelocities.LinearVelocity.X), e.TotalManipulation.Translation.Y * Math.Abs(e.FinalVelocities.LinearVelocity.Y)); //if (Math.Abs(e.FinalVelocities.LinearVelocity.X) > 0.5 || Math.Abs(e.FinalVelocities.LinearVelocity.Y) > 0.5) //{ // MatrixAnimation b = new MatrixAnimation() // { // From = from, // To = to, // Duration = TimeSpan.FromMilliseconds(500), // FillBehavior = FillBehavior.HoldEnd // }; // (el.RenderTransform as MatrixTransform).BeginAnimation(MatrixTransform.MatrixProperty, b); //} base.OnManipulationCompleted(e); }
private void textBlock1_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (e.TotalManipulation.Translation.X < -100)// move the object to left { textBlockSendIndicator.Text = "Must sent"; //DoubleAnimation da = new DoubleAnimation(); //da.Duration = new Duration(new TimeSpan(0, 0, 2)); //da.To = 0; //Storyboard myStoryboard = new Storyboard(); //myStoryboard.Children.Add(da); //Storyboard.SetTargetName(da, "textBlock1"); //Storyboard.SetTargetProperty(da, new PropertyPath(Rectangle.OpacityProperty)); //myStoryboard.Begin(); FadeTextBlock.Begin(); client.Send("__TEXT__" + textBlockText.Text); if (client.Receive() == "__TEXT__RECV") { textBlockSendIndicator.Text = "Successful sent."; } } else { textBlockSendIndicator.Text = "Dont send."; } }
private void LayoutRoot_OnManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (!_cancelRequested && Hint.Visibility == Visibility.Collapsed) { StopRecording(); } }
private void Border_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { // suppress zoom //if (e.FinalVelocities.ExpansionVelocity.X != 0.0 || // e.FinalVelocities.ExpansionVelocity.Y != 0.0) // e.Handled = true; }
void btnFull_ManipulationCompleted(object sender, ManipulationCompletedEventArgs args) { //DeBug... /* * txImgDetails.Text = "CX: " + (args.ManipulationOrigin.X - m_ptDragStart.X).ToString() + * "\r\n" + "CY: " + (args.ManipulationOrigin.Y - m_ptDragStart.Y).ToString(); */ imgFull.Margin = new Thickness(0); double dCX = args.ManipulationOrigin.X - m_ptDragStart.X; if (dCX > 100) { if (_Prev()) { args.Handled = true; } } else if (dCX < -100) { if (_Next()) { args.Handled = true; } } else { //NOP... } }
private void ListBox_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (IsBouncy) { IsBouncy = false; } }
void CalendarManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { e.Handled = true; while (TouchPanel.IsGestureAvailable) { var gesture = TouchPanel.ReadGesture(); if (gesture.GestureType == GestureType.Flick) { double horizontal = gesture.Delta.X / Factor; double vertical = gesture.Delta.Y / Factor; if (Math.Abs(vertical) > 1.5 * Math.Abs(horizontal)) { if (vertical > 0) { IncrementMonth(); } else { DecrementMonth(); } } } } }
/// <summary> /// Called when the ManipulationCompleted event occurs. /// </summary> /// <param name="e">Event data for the event.</param> protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e) { if (null == e) { throw new ArgumentNullException("e"); } base.OnManipulationCompleted(e); // Interaction needs to be on the _itemsPresenterHostPart or its children DependencyObject element = e.OriginalSource as DependencyObject; while (null != element) { if (_itemsPresenterHostPart == element) { // On interaction, switch to Expanded/Full mode if ((ListPickerMode.Normal == ListPickerMode) && (0 < Items.Count)) { ListPickerMode = (Items.Count <= ItemCountThreshold) ? ListPickerMode.Expanded : ListPickerMode.Full; e.Handled = true; } break; } element = VisualTreeHelper.GetParent(element); } }
protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e) { base.OnManipulationCompleted(e); // set it back this.PanningMode = this.panningMode; }
/// <summary> /// Converts <see cref="ManipulationCompletedEventArgs" /> to <see cref="OxyMouseEventArgs" /> for a touch completed event. /// </summary> /// <param name="e">The <see cref="ManipulationCompletedEventArgs" /> instance containing the event data.</param> /// <param name="relativeTo">The <see cref="UIElement" /> that the event is relative to.</param> /// <returns>A <see cref="OxyMouseEventArgs" /> containing the converted event arguments.</returns> public static OxyTouchEventArgs ToTouchEventArgs(this ManipulationCompletedEventArgs e, UIElement relativeTo) { return(new OxyTouchEventArgs { Position = e.ManipulationOrigin.ToScreenPoint() + e.TotalManipulation.Translation.ToScreenVector(), }); }
private void Swipable_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { if (e.FinalVelocities.LinearVelocity.X > 10) { this.SwipeTransform.TranslateX = 0; } }
private void Trackpad_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { var origin = e.ManipulationOrigin; ServerManager.CurrentServer.AppleTVTrackpadTouchRelease((short)origin.X, (short)origin.Y); _isDragging = false; }
private void HomepageTextBlock_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { new WebBrowserTask { URL = "http://www.pedrolamas.com" }.Show(); }
private void InkPresenter_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { double touchX = e.ManipulationOrigin.X + e.TotalManipulation.Translation.X; double touchY = e.ManipulationOrigin.Y + e.TotalManipulation.Translation.Y; #endif lastX = touchX; lastY = touchY; // Create a new path and move to the touched point. if (CurrentPath != null) { CurrentPath.Points.Add(new Point(touchX, touchY)); } Polyline newPath = SmoothedPathWithGranularity(0, CurrentPath.Points); newPath.Stroke = StrokeColor; newPath.StrokeThickness = StrokeThickness; inkPresenter.Children.Add(newPath); CurrentPath.Points.Clear(); NotifyIsBlankChanged(); }
/// <summary> /// Converts <see cref="ManipulationCompletedEventArgs" /> to <see cref="OxyMouseEventArgs" /> for a touch completed event. /// </summary> /// <param name="e">The <see cref="ManipulationCompletedEventArgs" /> instance containing the event data.</param> /// <param name="source">The <see cref="FrameworkElement"/> that is event source</param> /// <param name="relativeTo">The <see cref="UIElement" /> that the event is relative to.</param> /// <param name="offset">The <see cref="Vector" /> offset that event is relative to.</param> /// <returns>A <see cref="OxyMouseEventArgs" /> containing the converted event arguments.</returns> public static OxyTouchEventArgs ToTouchEventArgs(this ManipulationCompletedEventArgs e, FrameworkElement source, FrameworkElement relativeTo, Vector offset) { return(new OxyTouchEventArgs { Position = (source.TranslatePoint(e.ManipulationOrigin, relativeTo) + offset).ToScreenPoint(), }); }
private void mainFragment_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { // Get left of _listFragment var transform = (TranslateTransform)_listFragment.RenderTransform; if (transform == null) { return; } var left = transform.X; // Set snap divider to 1/3 of _mainFragment width var snapLimit = _mainFragment.ActualWidth / 3; // Get init position of _listFragment var initialPosition = -_listFragment.Width; // If current left coordinate is smaller than snap limit, close drawer if (Math.Abs(initialPosition - left) < snapLimit) { MoveListFragment(initialPosition, Color.FromArgb(0, 0, 0, 0)); _shadowFragment.Visibility = Visibility.Collapsed; _shadowFragment.IsHitTestVisible = false; _mainFragment.IsHitTestVisible = true; _mainFragment.ManipulationDelta -= mainFragment_ManipulationDelta; _mainFragment.ManipulationCompleted -= mainFragment_ManipulationCompleted; IsDrawerOpen = false; // raise DrawerClosed event if (DrawerClosed != null) { DrawerClosed(this); } } // else open drawer else if (Math.Abs(initialPosition - left) > snapLimit) { // move drawer to zero MoveListFragment(0, Color.FromArgb(190, 0, 0, 0)); _shadowFragment.Visibility = Visibility.Visible; _shadowFragment.IsHitTestVisible = true; _mainFragment.IsHitTestVisible = false; _mainFragment.ManipulationDelta -= mainFragment_ManipulationDelta; _mainFragment.ManipulationCompleted -= mainFragment_ManipulationCompleted; IsDrawerOpen = true; // raise DrawerClosed event if (DrawerOpened != null) { DrawerOpened(this); } } }
protected internal void websiteClick_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { var web = new WebBrowserTask { Uri = new Uri(WebSiteUrl) }; web.Show(); }
private void GestureManipulationCompleted(ManipulationCompletedEventArgs args) { if (CorrectHand(args.source)) { Transmitter.SendButton(_tracker, "manipulation", false); SetManipulation(0f, 0f, 0f); } }
private void OnManipulationComplete(ManipulationCompletedEventArgs obj) { stopManipulationThisFrame = true; isManipulating = false; manipulationFrameDelta = new Vector3(0, 0, 0); manipulationFullDelta = new Vector3(0, 0, 0); }
public void Ended(ManipulationCompletedEventArgs e) { Apply(e.ManipulationOrigin); Element = null; RaiseElementChanged(); TargetImage.Invalidate(); }
private void Items_OnManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { //if (_lastInvokeTime != null && _lastInvokeTime.Value.AddSeconds(10.0) > DateTime.Now) return; //_lastInvokeTime = DateTime.Now; //ViewModel.LoadNextSlice(); this.Focus(); }
private void canvas_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { var left = Canvas.GetLeft(LayoutRoot); if (_viewMoved) return; if (Math.Abs(initialPosition - left) < 100) { //bouncing back MoveViewWindow(initialPosition); return; } //change of state if (initialPosition - left > 0) { //slide to the left if (initialPosition > -420) MoveViewWindow(-420); else MoveViewWindow(-840); } else { //slide to the right if (initialPosition < -420) MoveViewWindow(-420); else MoveViewWindow(0); } }
/*private void newTaskForm_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) { }*/ private void newTaskForm_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { }
private void PhoneApplicationPage_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { }
private void query_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) { }