示例#1
0
 private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (_activeController == _musicController && musicListBox.SelectedItem != null)
     {
         playlistListBox.SelectedItem      = null;
         selectedSongDockPanel.DataContext = _musicController.List;
         Song song = (Song)musicListBox.SelectedItem;
         if (song != null)
         {
             _musicController.ChangeSelected(song);
             SetMusicForm();
             _newFile = null; // zorgt ervoor dat als song verandert, de added file niet gesavet wordt bij een andere song
         }
     }
     else if (_activeController == _movieController)
     {
         Movie movie = (Movie)movieListBox.SelectedItem;
         if (movie != null)
         {
             _movieController.ChangeSelected(movie);
             SetMovieForm();
             _newFile = null; //idem
         }
     }
     e.Handled = true;
 }
        private void SelectMovieItem(Movie movie)
        {
            textBoxDirector.Text   = movie.Director;
            textBoxMovieTitle.Text = movie.Title;

            if (movie.File != null)
            {
                checkBoxMovieFilePresent.IsChecked = true;
            }

            _movieController.ChangeSelected(movie);
        }