private void PlayButton_Click(object sender, RoutedEventArgs e) { if (playbackController.CurrentTrack == null) { //TODO: Use a more efficient call than this var selectedTrack = trackController.GetSelectedTrack(); if (selectedTrack != null) { SetNowPlaying(selectedTrack); } else if (trackController.TrackCount > 0) //boundTracks.Count > 0) { SetNowPlaying(trackController.GetTrackAt(0)); //boundTracks[0]); } } PlayCurrentTrack(); }
private void sourceLoadCompleted(object sender, EventArgs args) { try { if (trackController.TrackCount > 0) { var track = trackController.GetTrackAt(0); track.IsSelected = true; playbackController.Reset(); playbackView.SetNowPlaying(track); playbackView.PlayCurrentTrack(); } } catch (Exception ex) { logger.Error("MainWindow.sourceLoadedCompleted", ex); } }