Skip to content Skip to sidebar Skip to footer

MvvmCross Custom Event Binding Event Args

I have created a custom binding for the FocusChange event on an EditText using MvvmCross. I can get the event bound and firing, but I can't figure out how to pass the event args.

Solution 1:

After trying many different arrangements, I found that the correct syntax to wire up your MvxCommand is

public IMvxCommand FocusChange
{
    get
    {
        return new MvxCommand<EditText.FocusChangeEventArgs>(e => OnFocusChange(e));
    }
}

private void OnFocusChange(EditText.FocusChangeEventArgs e)
{
    if (!e.HasFocus)
    {
         //Do Something
    }
}

Hope this helps!


Post a Comment for "MvvmCross Custom Event Binding Event Args"