Пример #1
0
 private void Control_Touch(object sender, Android.Views.View.TouchEventArgs e)
 {
     if (e.Event.Action == MotionEventActions.Down)
     {
         var command = PressedEffect.GetLongPressedCommand(Element);
         command?.Execute(PressedEffect.GetLongParameter(Element));
     }
     else if (e.Event.Action == MotionEventActions.Up)
     {
         var command = PressedEffect.GetLongRelesedCommand(Element);
         command?.Execute(PressedEffect.GetLongParameter(Element));
     }
 }
 private void HandleLongClick(UILongPressGestureRecognizer recognizer)
 {
     if (recognizer.State == UIGestureRecognizerState.Began)
     {
         var command = PressedEffect.GetLongPressedCommand(Element);
         command?.Execute(PressedEffect.GetLongParameter(Element));
     }
     else if (recognizer.State == UIGestureRecognizerState.Ended)
     {
         var command = PressedEffect.GetLongRelesedCommand(Element);
         command?.Execute(PressedEffect.GetLongParameter(Element));
     }
 }