void Instance_PlayStateChanged(object sender, EventArgs e)
{
var playState = BackgroundAudioPlayer.Instance.PlayerState;
switch (playState)
{
case PlayState.TrackReady:
Debug.WriteLine("Track ready");
break;
case PlayState.BufferingStarted:
_viewModel.Busy = true;
Debug.WriteLine("Buffering");
break;
case PlayState.BufferingStopped:
//_viewModel.Busy = false;
break;
case PlayState.Paused:
case PlayState.Stopped:
var playButton = ApplicationBar.Buttons[0] as ApplicationBarIconButton;
playButton.Text = "Play";
playButton.IconUri = new Uri("/Images/play.png", UriKind.Relative);
break;
case PlayState.Playing:
_viewModel.Busy = false;
playButton = ApplicationBar.Buttons[0] as ApplicationBarIconButton;
playButton.Text = "Stop";
playButton.IconUri = new Uri("/Images/pause.png", UriKind.Relative);
break;
default:
Debug.WriteLine(playState);
break;
}
}