void RechercheUtilisateur(string recherche) { lstRecherche.Items.Clear(); foreach (Utilisateur u in _utilisateurs.UtilisateurByDebutNom(recherche)) { //ListBoxItem item = new ListBoxItem(); lstRecherche.Items.Add(u.Nom); } }
/// <summary> /// remplie la liste Box /// </summary> private void DataBindingListBoxUtilisateurs(string nomRechercher) { Utilisateurs listeUtil = new Utilisateurs(); listeUtil.Load(new SauvegardeXML(), Paramètres.Default.path); if (string.IsNullOrEmpty(nomRechercher)) { ListBoxUtilisateurs.ItemsSource = listeUtil; } else { ListBoxUtilisateurs.ItemsSource = listeUtil.UtilisateurByDebutNom(nomRechercher.Trim()); } }