void btnDelete_Click(object sender, RoutedEventArgs e) { agentsetId = new ObservableCollection <string>(); if (DaGr.SelectedItems.Count > 0) { for (int i = 0; i < DaGr.SelectedItems.Count; i++) { T_OA_AGENTSET ent = DaGr.SelectedItems[i] as T_OA_AGENTSET; agentsetId.Add((DaGr.SelectedItems[i] as T_OA_AGENTSET).AGENTSETID); string Result = ""; ComfirmWindow com = new ComfirmWindow(); com.OnSelectionBoxClosed += (obj, result) => { SoaChannel.DeleteAgentSetAsync(agentsetId); LoadData(); }; com.SelectionBox(Utility.GetResourceStr("DELETECONFIRM"), Utility.GetResourceStr("DELETEALTER"), ComfirmWindow.titlename, Result); } } else { ComfirmWindow.ConfirmationBox(Utility.GetResourceStr("CONFIRMINFO"), Utility.GetResourceStr("SELECTERROR", "DELETE"), Utility.GetResourceStr("CONFIRMBUTTON")); } }