Using System.Diagnostics.Debug. First pass at player controls styling

This commit is contained in:
watsonb8
2019-12-04 14:53:49 -08:00
parent 22a524cfd1
commit 187de97503
25 changed files with 169 additions and 101 deletions

View File

@ -22,8 +22,6 @@ namespace Aurora.Design.Views.Songs
_songsList = new ObservableCollection<BaseMedia>();
PlayCommand = new Command(OnPlayButtonExecute, CanPlayButtonExecute);
_player.PlaybackStateChanged += OnPlaybackStateChanged;
Initialize();
}
@ -87,6 +85,10 @@ namespace Aurora.Design.Views.Songs
public async override void OnPlayButtonExecute()
{
if (_selectedSong == null)
{
return;
}
base.Media = _selectedSong;
if (!_player.IsMediaLoaded(base.Media))
{
@ -98,16 +100,19 @@ namespace Aurora.Design.Views.Songs
case PlaybackState.Buffering:
{
_player.Play();
SetIsPlaying(true);
break;
}
case PlaybackState.Playing:
{
_player.Pause();
SetIsPlaying(false);
break;
}
case PlaybackState.Stopped:
{
_player.Play();
SetIsPlaying(true);
break;
}
}
@ -124,18 +129,5 @@ namespace Aurora.Design.Views.Songs
}
#endregion Commands
#region Events
/// <summary>
/// PlayerService playback state changed event handler.
/// </summary>
/// <param name="sender">The sending object.</param>
/// <param name="args">Event arguments.</param>
public void OnPlaybackStateChanged(object sender, PlaybackStateChangedEventArgs args)
{
OnPropertyChanged("PlayButtonText");
}
#endregion Events
}
}