private void Play_Click(object sender, RoutedEventArgs e) { DisplayIndex item = (DisplayIndex)LeftGridView.SelectedItem; if (item == null) { MessageBox.Show("Please select a Mp3"); return; } // Very first if (IsStopped && !IsPlaying) { audioPlayback.Load(item.FullName); audioPlayback.Play(); IsPlaying = true; Debug.WriteLine("Playing ::: " + item.FullName); timer.Start(); } // Pause it else if (IsPlaying) { Pause(); } else { audioPlayback.Play(); Debug.WriteLine("Play AGAIN ::: " + item.FullName); IsPlaying = true; IsStopped = false; timer.Start(); } }
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { StopPlayer(); DataGrid lv = (DataGrid)sender; DisplayIndex item = (DisplayIndex)lv.SelectedItem; SelectedFullPath = item.FullName; Debug.WriteLine("Selected ::: " + item.FullName); }