private void Supprimer_Click(object sender, RoutedEventArgs e) { try { if (dgImport.SelectedItem != null) { var objetselectionne = (aImportFichier)dgImport.SelectedItem; bool result = false; AdministrationServiceClient service1 = new AdministrationServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Administration")); service1.SuppressImportFichierCompleted += (sr, res) => { if (res != null && res.Cancelled) { return; } result = res.Result; if (result == true) { ChargeGrid(); MessageBox.Show("Supprimé"); } else { MessageBox.Show("Echec"); } }; service1.SuppressImportFichierAsync(objetselectionne); service1.CloseAsync(); } } catch (Exception ex) { Message.ShowError(ex.Message, "Echec"); } }