void Recherche() { try { btnsearch.IsEnabled = false; aClient critere = new aClient(); critere.Centre = (string.IsNullOrEmpty(this.txtCentre.Text)) ? string.Empty : this.txtCentre.Text; critere.Client = (string.IsNullOrEmpty(this.txtClient.Text)) ? string.Empty : this.txtClient.Text; critere.Ordre = (string.IsNullOrEmpty(this.txtOrdre.Text)) ? string.Empty : this.txtOrdre.Text; RecouvrementServiceClient client = new RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement")); client.RechercherListeClientsCompleted += (ss, args) => { if (args.Cancelled || args.Error != null) { string error = args.Error.Message; MessageBox.Show(args.Error.Message, "RechercherListeClients", MessageBoxButton.OK); btnsearch.IsEnabled = true; return; } if (args.Result == null || args.Result.Count == 0) { MessageBox.Show("Aucune donnée trouvée", "RechercherListeClients", MessageBoxButton.OK); btnsearch.IsEnabled = true; return; } List <aClient> clients = new List <aClient>(); clients.AddRange(args.Result); this.lvwResultat.ItemsSource = null; this.lvwResultat.ItemsSource = clients; btnsearch.IsEnabled = true; }; client.RechercherListeClientsAsync(critere); } catch (Exception ex) { btnsearch.IsEnabled = true; string error = ex.Message; //MessageBox.Show(ex.Message, Program.rm.GetString("msgSuiviRecouvrements"), MessageBoxButtons.OK, MessageBoxIcon.Information); } }