Esempio n. 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            System.Windows.Data.CollectionViewSource filmViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("filmViewSource")));
            films = fManager.GetAlleFilms();
            filmViewSource.Source    = films;
            films.CollectionChanged += this.OnCollectionChanged;
            gridDetail.DataContext   = filmViewSource; // Datacontext wordt hier ingevuld, om initiële validatie tegen te gaan.

            System.Windows.Data.CollectionViewSource genreViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("genreViewSource")));
            genres = gManager.GetAlleGenres();
            genreViewSource.Source = genres;
        }
Esempio n. 2
0
 //VULCOMBOBOX/////////////////////////////////////////////////////////////////////////////
 public void VulDeComboBox()
 {
     try
     {
         CollectionViewSource genreViewSource = ((CollectionViewSource)(this.FindResource("genreViewSource")));
         var manager = new GenreManager();
         var GenreOb = new ObservableCollection <Genre>();
         GenreOb = manager.GetAlleGenres();
         genreViewSource.Source = GenreOb;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }