private void PauseButton_Click(object sender, RoutedEventArgs e) { Player.Pause(); if (Player.CurrentStatus == MediaStatus.Playing) { PauseButton.Content = "Pause"; MediaResume?.Invoke(this, new EventArgs()); } else { PauseButton.Content = "Resume"; MediaPause?.Invoke(this, new EventArgs()); } }
private void Player_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e) { if (e.newState == (int)WMPLib.WMPPlayState.wmppsPlaying) { MediaResume?.Invoke(this, new EventArgs()); } else if (e.newState == (int)WMPLib.WMPPlayState.wmppsPaused) { MediaPause?.Invoke(this, new EventArgs()); } else if (e.newState == (int)WMPLib.WMPPlayState.wmppsStopped) { MediaStop?.Invoke(this, new EventArgs()); } }
public void OnMediaPause() => MediaPause?.Invoke();