Exemplo n.º 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 SelectMusicItem(Song song)
        {
            textBoxSinger.Text    = song.Singer;
            textBoxSongTitle.Text = song.Title;

            if (song.File != null)
            {
                checkBoxMusicFilePresent.IsChecked = true;
            }

            _musicController.ChangeSelected(song);
        }