private void ButtonPlayNext_PreviewMouseUp(object sender, MouseButtonEventArgs e) { if (seekInProgress) { seekInProgress = false; dtSeek.Stop(); ButtonPlayNext.ReleaseMouseCapture(); e.Handled = true; } else { dtSeek.Stop(); ButtonPlayNext.ReleaseMouseCapture(); NextTrack(); } }
void dtSeek_Tick(object sender, EventArgs e) { if (Mouse.LeftButton == MouseButtonState.Pressed) { if (DateTime.Now - dtPlayNextPressed > TimeSpan.FromMilliseconds(500)) { if (seekInProgressForward) { Playlist.CurrentTrackPlayPosition += 1000; ButtonPlayNext.CaptureMouse(); } else { Playlist.CurrentTrackPlayPosition -= 1000; ButtonPlayPrev.CaptureMouse(); } seekInProgress = true; } } }