private void b_Delete_Click(object sender, RoutedEventArgs e) { if (dg_goods.SelectedItems.Count == 0) { MessageBox.Show("Позиция не выбрана", "Внимание!"); return; } Good item = (Good)dg_goods.SelectedValue; WCFStoreServiceManager.StoreServiceClient client = new StoreServiceClient(); client.DeleteGood(item); //WCFClient wcfc = new WCFClient(); //wcfc.DeleteGood(item); MessageBox.Show("Позиция удалена", "Внимание!"); }