Multiple spinners

0

I am creating an app in which I have a TableLayout , in which I add TableRow dynamically with Spinners and TextEdit .

Is it possible to create a% common% for all EventHandler ?

    
asked by anonymous 17.04.2017 / 19:41

1 answer

2

I do not know if this is what you want, but you can assign events from multiple objects to the same function:

FindViewById<Spinner>(Resource.Id.Spn1).Click += EventoClick_Click;
FindViewById<Spinner>(Resource.Id.Spn2).Click += EventoClick_Click;

private void EventoClick_Click(object sender, EventArgs e)
{
   //Aqui você pode manipular o objeto que chamou o evento usando o sender           
}
    
18.04.2017 / 15:29