Listview handle click button event from parent form

PedroGonPedroGon ESMember ✭✭
edited November 2016 in Xamarin.Forms

Hi,

I need to handle the click button event in a viewcell, from the parent form that contains the Listview. Here is an example of my viewcell.

public class ContactCell : ViewCell
{
    public ContactCell()
    {
        var okButton = new Button()
        {
            Text = "OK"
        };
        okButton.Clicked += okButton_Clicked;

        var frame = new Frame
        {
            Padding = 0,
            Margin = 0,
            Content = okButton
        };

        View = frame;
    }

    private async void okButton_Clicked(object sender, EventArgs e)
    {
        -------------> delete current item
    }
}

Any ideas?

Thanks in advance.

Sign In or Register to comment.