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
{
returnnew MvxCommand<EditText.FocusChangeEventArgs>(e => OnFocusChange(e));
}
}
privatevoidOnFocusChange(EditText.FocusChangeEventArgs e)
{
if (!e.HasFocus)
{
//Do Something
}
}
Hope this helps!
Post a Comment for "Mvvmcross Custom Event Binding Event Args"