public void TogglePlayPause()
        {
            IPlayer player = GetCurrentPlayer();

            if (player == null)
            {
                NextItem();
                return;
            }
            IMediaPlaybackControl mpc = player as IMediaPlaybackControl;

            if (mpc == null)
            {
                return;
            }
            if (player.State == PlayerState.Active)
            {
                if (mpc.IsPaused)
                {
                    mpc.Resume();
                }
                else
                {
                    mpc.Pause();
                }
            }
            else
            {
                mpc.Restart();
            }
        }
        public void Pause()
        {
            IMediaPlaybackControl player = GetCurrentPlayer() as IMediaPlaybackControl;

            if (player != null)
            {
                player.Pause();
            }
        }