aurora/Aurora/Frontend/Views/Songs/SongsViewModel.cs
2019-05-19 20:25:31 -04:00

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<BaseSong> _songsList;
private BaseSong _selectedSong;
#endregion Fields
#region Constructor
public SongsViewModel()
{
_songsList = new ObservableCollection<BaseSong>();
Initialize();
}
#endregion Constructor
#region Properties
public ObservableCollection<BaseSong> SongsList
{
get { return _songsList; }
set
{
if (value != _songsList)
{
_songsList = value;
OnPropertyChanged("SongList");
}
}
}
public BaseSong 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
}
}