private void OnKeyPress(object sender, KeyPressedEventArgs eventArgs) { var keyPressed = eventArgs.HotKey.Key; switch (keyPressed) { case (Key.MediaPlayPause): { PlayPausePressed?.Invoke(this, null); break; } case (Key.MediaStop): { StopPressed?.Invoke(this, null); break; } case (Key.MediaPreviousTrack): { PreviousTrackPressed?.Invoke(this, null); break; } case (Key.MediaNextTrack): { NextTrackPressed?.Invoke(this, null); break; } } }
public void OnStopPressed() { StopPressed?.Invoke(this, null); }