Answers for "xamarin loop add unique buttons"

0

xamarin loop add unique buttons

void Button_Click(object sender, EventArgs e)
{
    Button senderButton = sender as Button;
    int itemID = -1;
    if (senderButton != null && senderButton.ID.Contains('-'))
    {
        itemID = int.Parse(senderButton.ID.Split('-')[1]); //or int.TryParse (better)
        //work with itemID
    }
}
Posted by: Guest on March-13-2020

Browse Popular Code Answers by Language