Using System.Diagnostics.Debug. First pass at player controls styling
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user