📜  xamarin 循环添加唯一按钮 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:30.558000             🧑  作者: Mango

代码示例1
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
    }
}