64 lines
1.4 KiB
C#
64 lines
1.4 KiB
C#
using System.Collections.ObjectModel;
|
|
using Aurora.Backend.Models;
|
|
using Aurora.Backend.Services;
|
|
|
|
namespace Aurora.Frontend.Views.Songs
|
|
{
|
|
public class SongsViewModel : BaseViewModel
|
|
{
|
|
#region Fields
|
|
private ObservableCollection<Song> _songsList;
|
|
private Song _selectedSong;
|
|
|
|
#endregion Fields
|
|
|
|
#region Constructor
|
|
public SongsViewModel()
|
|
{
|
|
_songsList = new ObservableCollection<Song>();
|
|
Initialize();
|
|
}
|
|
|
|
#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()
|
|
{
|
|
|
|
SongsList = LibraryService.Instance.GetLibrary();
|
|
}
|
|
|
|
#endregion Methods
|
|
|
|
}
|
|
}
|