2019-05-19 20:21:54 -04:00
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using Aurora.Backend.Models;
|
|
|
|
|
using Aurora.Backend.Services;
|
2019-05-19 17:25:42 -04:00
|
|
|
|
|
2019-05-18 17:25:36 -04:00
|
|
|
|
namespace Aurora.Frontend.Views.Songs
|
|
|
|
|
{
|
2019-05-19 17:25:42 -04:00
|
|
|
|
public class SongsViewModel : BaseViewModel
|
2019-05-18 17:25:36 -04:00
|
|
|
|
{
|
2019-05-19 17:25:42 -04:00
|
|
|
|
#region Fields
|
|
|
|
|
private ObservableCollection<Song> _songsList;
|
|
|
|
|
private Song _selectedSong;
|
|
|
|
|
|
|
|
|
|
#endregion Fields
|
|
|
|
|
|
|
|
|
|
#region Constructor
|
2019-05-18 17:25:36 -04:00
|
|
|
|
public SongsViewModel()
|
|
|
|
|
{
|
2019-05-19 17:25:42 -04:00
|
|
|
|
_songsList = new ObservableCollection<Song>();
|
|
|
|
|
Initialize();
|
2019-05-18 17:25:36 -04:00
|
|
|
|
}
|
2019-05-19 17:25:42 -04:00
|
|
|
|
|
|
|
|
|
#endregion Constructor
|
|
|
|
|
|
|
|
|
|
#region Properties
|
|
|
|
|
public ObservableCollection<Song> SongsList
|
|
|
|
|
{
|
|
|
|
|
get { return _songsList; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _songsList)
|
|
|
|
|
{
|
|
|
|
|
_songsList = value;
|
|
|
|
|
OnPropertyChanged("SongList");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Song SelectedSong
|
|
|
|
|
{
|
|
|
|
|
get { return _selectedSong; }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value != _selectedSong)
|
|
|
|
|
{
|
|
|
|
|
_selectedSong = value;
|
|
|
|
|
OnPropertyChanged("SelectedSong");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion Properties
|
|
|
|
|
|
|
|
|
|
#region Methods
|
|
|
|
|
public void Initialize()
|
|
|
|
|
{
|
|
|
|
|
|
2019-05-19 20:21:54 -04:00
|
|
|
|
SongsList = LibraryService.Instance.GetLibrary();
|
2019-05-19 17:25:42 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion Methods
|
|
|
|
|
|
2019-05-18 17:25:36 -04:00
|
|
|
|
}
|
|
|
|
|
}
|