private void ButtonStart_Click(object sender, RoutedEventArgs e) { ListFilesPage lstFilesPage = null; if (Settings.CurrentPageTitle.Equals("LeftPage") && !Utils.IsCurrentMusic()) { lstFilesPage = Settings.LeftPage as ListFilesPage; } if (Settings.CurrentPageTitle.Equals("RightPage") && !Utils.IsCurrentMusic()) { lstFilesPage = Settings.RightPage as ListFilesPage; } if (lstFilesPage != null) { MediaElementAudioPlayer.Source = new Uri( lstFilesPage.GetBasePath() + lstFilesPage.GetCurrentSelectedFilename()); Settings.CurrentSelectedFilename = lstFilesPage.GetCurrentSelectedFilename(); Settings.CurrentSelectedIndex = lstFilesPage.GetCurrentSelectedIndex(); } MediaElementAudioPlayer.Play(); timer.Start(); }
private void SliderAudioPlayer_LostMouseCapture(object sender, MouseEventArgs e) { MediaElementAudioPlayer.Pause(); MediaElementAudioPlayer.Position = TimeSpan.FromSeconds(SliderAudioPlayer.Value); MediaElementAudioPlayer.Play(); IsValueChanged = false; IsMouseCapture = false; }
private void ButtonPause_Click(object sender, RoutedEventArgs e) { MediaElementAudioPlayer.Pause(); timer.Stop(); }