The situation : I have a list of view which contains an EditText. I want the user to be able to modify the text and only send his new text to the viewmodel when he press on the done button on the keyboard. My edit text is binded has follow
<EditText
android:id="@+id/textNumero"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.23"
android:textColor="#ffffffff"
local:MvxBind="Text BarilId" />
I found on the internet that i can you use this event to do what i want:
idEditText.OnEditorAction (ImeAction.Done) += //insert delegate here
Unfortunately, i can't reach my activity since i'm binding the class in my list.
So, i thought of binding a command in my class like this:
<EditText
android:id="@+id/textNumero"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.23"
android:textColor="#ffffffff"
local:MvxBind="OnEditorAction EditCommand"
local:MvxBind="Text BarilId" />
The command :
private IMvxCommand _editCommand;
public IMvxCommand EditCommand
{
get {
_editCommand = _editCommand ?? new MvxCommand(() => {
//do validation here
});
return _editCommand;
}
}
But I don't know how to pass the ImeAction.Done
to my command or if i even receiving something like that.
Can i have some help on the remaining part?