More progress on IoC. Controllers are implemented
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Aurora.Models.Media;
|
||||
using Aurora.Services;
|
||||
using Aurora.Services.Library;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Aurora.Design.Views.Songs
|
||||
@ -10,15 +10,18 @@ namespace Aurora.Design.Views.Songs
|
||||
#region Fields
|
||||
private ObservableCollection<BaseMedia> _songsList;
|
||||
private BaseMedia _selectedSong;
|
||||
private ILibraryService _libraryService;
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Constructor
|
||||
public SongsViewModel()
|
||||
public SongsViewModel(ILibraryService libraryService)
|
||||
{
|
||||
_songsList = new ObservableCollection<BaseMedia>();
|
||||
DoubleClickCommand = new Command(OnDoubleClickExecute, OnDoubleClickCanExecute);
|
||||
|
||||
this._libraryService = libraryService;
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@ -45,7 +48,7 @@ namespace Aurora.Design.Views.Songs
|
||||
public void Initialize()
|
||||
{
|
||||
|
||||
SongsList = LibraryService.Instance.GetLibrary();
|
||||
SongsList = this._libraryService.GetLibrary();
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
Reference in New Issue
Block a user