Пример #1
0
        public async void deleteInspection(object sender, EventArgs e)
        {
            //Warn that this is permanent.  Ask if they're sure.
            BoundMenuItem <Inspection> button = (BoundMenuItem <Inspection>)sender;
            Inspection inspection             = button.BoundObject;
            bool       answer = await DisplayAlert("Confirm Deletion", "Are you sure you want to delete " + inspection.Name + "?  All its data and scores will be lost.", "Yes", "No");

            if (!answer)
            {
                return;
            }
            Inspection.DeleteInspection(inspection);
            if (checklist.Inspections.Contains(inspection))
            {                   //This is supposed to be removed in the DeleteInspection method, but there appear to be multiple copies of som
                //objects in memory.
                checklist.Inspections.Remove(inspection);
            }
            ResetInspections();
        }