private void FillMonths() { try { int loaderHandler = LoadingManager.BeginLoading("Please Wait for pass payment ... "); ddbMois.Items.Clear(); ReportServiceClient service = new ReportServiceClient(); service.GetALLMoisComptableAsync(); service.GetALLMoisComptableCompleted += (er, res) => { try { if (res.Error != null || res.Cancelled) { LoadingManager.EndLoading(loaderHandler); throw new Exception("Cannot display report"); } if (res.Result != null) { //Code en cas de succès //listeMois.Add(new CsArrete()); listeMois.AddRange(res.Result); foreach (var item in res.Result) { listeMois_.Add(item); } ddbMois.ItemsSource = listeMois_; //foreach (CsArrete mois in listeMois) // ddbMois.Items.Add(new { ANNMOIS = mois.ANNMOIS }); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { LoadingManager.EndLoading(loaderHandler); } }; } catch (Exception ex) { MessageBox.Show(ex.Message); } }