This repository has been archived on 2020-12-20. You can view files and clone it, but cannot push or open issues or pull requests.
aurora-sharp-desktop/Aurora/Frontend/Views/Songs/SongsViewModel.cs
2019-05-19 20:21:54 -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<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
}
}