/// <summary>
 /// Handles the PlaybackStarted event of the PlaybackManager control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="PlaybackEventArgs" /> instance containing the event data.</param>
 void PlaybackManager_PlaybackStarted(object sender, PlaybackEventArgs e)
 {
     if (e.Player is BaseInternalMediaPlayer)
     {
         App.Instance.ApplicationWindow.Dispatcher.Invoke(() => NowPlayingButton.Visibility = Visibility.Visible);
     }
 }
        /// <summary>
        /// Handles the PlaybackStarted event of the PlaybackManager control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="PlaybackEventArgs" /> instance containing the event data.</param>
        void PlaybackManager_PlaybackStarted(object sender, PlaybackEventArgs e)
        {
            if (e.Player is BaseInternalMediaPlayer)
            {
                CurrentPlayer = e.Player;
                CurrentPlayer.PlayStateChanged += CurrentPlayer_PlayStateChanged;

                ResetButtonVisibilities(e.Player);

                Dispatcher.InvokeAsync(() =>
                {
                    var runtime = e.Player.CurrentMedia.RunTimeTicks ?? 0;
                    CurrentPositionSlider.Maximum = runtime;

                    TxtDuration.Text = GetTimeString(runtime);

                });

                CurrentPositionTimer = new Timer(CurrentPositionTimerCallback, null, 250, 250);
            }
        }