void btnDelete_Click(object sender, RoutedEventArgs e) { string Result = ""; if (DtGrid.SelectedItems.Count > 0) { ObservableCollection <string> ids = new ObservableCollection <string>(); foreach (T_HR_ATTENDMACHINESET tmp in DtGrid.SelectedItems) { ids.Add(tmp.ATTENDMACHINESETID); } ComfirmWindow com = new ComfirmWindow(); com.OnSelectionBoxClosed += (obj, result) => { client.AttendMachineSetDeleteAsync(ids); }; com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result); } else { Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("SELECTERROR", "DELETE")); } }