private static ObservableCollection<Anime> CastListToObservableAnime(Anime[] animes) { List<Anime> li = new List<Anime>(); li = animes.ToList<Anime>(); ObservableCollection<Anime> myAnimeListView = new ObservableCollection<Anime>(); for (int i = 0; i < li.Count(); i++) { myAnimeListView.Add(li[i]); } return myAnimeListView; }
public void PopulateListView () { Anime anime = new Anime(); anime.nom = "Petit"; anime.prenom = "Arnaud"; childrenPresents.Add(anime); Anime anime1 = new Anime(); anime1.nom = "Mathieu"; anime1.prenom = "Bastien"; childrenPresents.Add(anime1); Anime anime2 = new Anime(); anime2.nom = "Herman"; anime2.prenom = "Axel"; childrenPresents.Add(anime2); }