public void AddNewEquipment(object sender, EventArgs e) { UIButton btnAddNew = (UIButton)sender; int iTagId = btnAddNew.Tag; int iPwrIdRow = iTagId /(m_iEquipmentSectionCounter+1) - iPwrIdNewBtnTagId; //This is 1 based iUtils.AlertBox alert2 = new iUtils.AlertBox(); alert2.CreateAlertRackSubRackPositionStringDialog(); alert2.SetAlertMessage("Are you adding a rack, subrack, position item or solar panel string?"); alert2.ShowAlertBox(); UIAlertView alert3 = alert2.GetAlertDialog(); alert3.Clicked += (sender2, e2) => {AddNewItem(sender2, e2, e2.ButtonIndex, iPwrIdRow);}; }