Hello,
Welcome to our Microsoft Q&A platform!
That all worked fine until I found out that when the users taps away from the input keyboard the text is saved but the ReturnCommand is not executed.
When we check document Customize the return key, we will find that :
The appearance of the return key on the soft keyboard, which is displayed when an Entry has focus, can be customized by setting the ReturnType property to a value of the ReturnType enumeration:
- Default – indicates that no specific return key is required and that the platform default will be used.
- Done – indicates a "Done" return key.
- Go – indicates a "Go" return key.
- Next – indicates a "Next" return key.
- Search – indicates a "Search" return key.
- Send – indicates a "Send" return key.
And when the return key is pressed, the Completed
event fires and any ICommand specified by the ReturnCommand
property is executed.
So, the ReturnCommand
is triggered only when the return key on the soft keyboard is clicked. That's why when you taps away from the input keyboard, the event didn't fire.
I cannot use the set property of the variable in the binding because that would modify the text while the user is typing, which makes a big mess.
For this ,we usually set property of the variable in the binding to achieve this funtion just as you mendtioned.
For more details, you can refer to the official document: The Xamarin.Forms Command Interface .
In addition, what do you mean by words a big mess
? Can you explain it in detail?
Best Regards,
Jessie Zhang
---
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.