93be6dc100
Added PageContainer to dynamically load pages within the main content. Added player component to control music playback(Half functional). Added playback changed event not the player service.
61 lines
1.4 KiB
C#
61 lines
1.4 KiB
C#
using System.Collections.ObjectModel;
|
|
using Aurora.Backend.Models;
|
|
using Aurora.Backend.Services;
|
|
using Aurora.Backend.Services.PlayerService;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Aurora.Frontend.Views.Songs
|
|
{
|
|
public class SongsViewModel : BaseViewModel
|
|
{
|
|
#region Fields
|
|
private ObservableCollection<BaseMedia> _songsList;
|
|
private BaseMedia _selectedSong;
|
|
|
|
#endregion Fields
|
|
|
|
#region Constructor
|
|
public SongsViewModel()
|
|
{
|
|
_songsList = new ObservableCollection<BaseMedia>();
|
|
PlayCommand = new Command(PlayExecute);
|
|
Initialize();
|
|
}
|
|
|
|
#endregion Constructor
|
|
|
|
#region Properties
|
|
public ObservableCollection<BaseMedia> SongsList
|
|
{
|
|
get { return _songsList; }
|
|
set { SetProperty(ref _songsList, value); }
|
|
}
|
|
|
|
public BaseMedia SelectedSong
|
|
{
|
|
get { return _selectedSong; }
|
|
set { SetProperty(ref _selectedSong, value); }
|
|
}
|
|
|
|
public Command PlayCommand { get; private set; }
|
|
|
|
#endregion Properties
|
|
|
|
#region Methods
|
|
public void Initialize()
|
|
{
|
|
|
|
SongsList = LibraryService.Instance.GetLibrary();
|
|
}
|
|
|
|
public void PlayExecute()
|
|
{
|
|
PlayerService.Instance.LoadMedia(_selectedSong);
|
|
PlayerService.Instance.Play();
|
|
}
|
|
|
|
#endregion Methods
|
|
|
|
}
|
|
}
|