private void ContentControlManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) { if (e.PointerDeviceType != PointerDeviceType.Touch) { return; } var diffY = Math.Abs(e.Position.Y - manipulationStartPosition.Y); if (diffY > 100) { return; } var diffX = e.Position.X - manipulationStartPosition.X; if (diffX > 100) { SwipeLeftCommand?.Execute(null); } else if (diffX < 100) { SwipeRightCommand?.Execute(null); } }
void IMycoSwipeGestureRecognizerController.SendSwipeRight(MycoView view) { if (SwipeRightCommand != null) { SwipeRightCommand.Execute(SwipeRightCommandParameter); } if (SwipeRight != null) { SwipeRight(view, new EventArgs()); } }
public void OnSwipeRight() { if (SwipeRightCommand != null && SwipeRightCommand.CanExecute(null)) { SwipeRightCommand.Execute(null); } EventHandler handler = SwipeRight; if (handler != null) { handler(this, new EventArgs()); } }
public void SwipeRightEvent() { var para = SwipeRightCommandParameter ?? CommandParameter; if (null != SwipeRightCommand) { if (SwipeRightCommand.CanExecute(para)) { SwipeRightCommand.Execute(para); } } else { SwipeRight?.Invoke(this, para); } }