Forum Xamarin Xamarin.Forms

"Button.Released" not triggered if you move the finger a little while the button is still pressed.

Hello everyone. I have a problem with Xamarin.Forms.Buttons. I want my app to execute an action when the user presses the button, and a different action when the user releases it. The problem is that once you have pressed the button if you move the finger(while you are still touching the screen), the released event will never be triggered even when you release the finger. When you move the finger, the button makes the animation like it was released/lostFocused but the "Released" event is not triggered. If you press and release again the same button without moving the finger, both events are triggered.

I would like always to know when the user has finished pressing a button.

Is there a way to make the "Released" event trigger in that situation?
Can I make the button has a "IsPressed" property or something simillar, so I can check it?
Can I check for example a "Screen.IsPressed" to know that the whole screen is not touched anywhere?

Thank you very much in advance.

Best Answer

Answers

  • Azti_IlunaAzti_Iluna Member

    Thanks for your reply. I was able to solve my problem using your idea. In my case "MotionEventActions.Cancel" is the one that I have to look at. Thank you again. :)

Sign In or Register to comment.