private void btnDelete_Click(object sender, RoutedEventArgs e) { if (dgArchives.SelectedItems.Count > 0) { string Result = ""; string errorMsg = ""; archivesDelID = new ObservableCollection <string>(); ComfirmWindow com = new ComfirmWindow(); com.OnSelectionBoxClosed += (obj, result) => { for (int i = 0; i < dgArchives.SelectedItems.Count; i++) { string MeetingTypeID = ""; MeetingTypeID = (dgArchives.SelectedItems[i] as T_OA_ARCHIVES).ARCHIVESID; if (!(archivesDelID.IndexOf(MeetingTypeID) > -1)) { archivesDelID.Add(MeetingTypeID); } } client.DeleteArchivesAsync(archivesDelID, errorMsg); }; com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result); } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON")); } }