More progress on IoC. Controllers are implemented
This commit is contained in:
@ -22,6 +22,14 @@
|
||||
<Entry
|
||||
Text="{Binding Port}"/>
|
||||
</StackLayout>
|
||||
<StackLayout
|
||||
Orientation="Horizontal">
|
||||
<Label
|
||||
VerticalOptions="Center"
|
||||
Text="Path to Library"/>
|
||||
<Entry
|
||||
Text="{Binding LibraryPath}"/>
|
||||
</StackLayout>
|
||||
</StackLayout>
|
||||
</ContentView.Content>
|
||||
</ContentView>
|
@ -32,5 +32,15 @@ namespace Aurora.Design.Views.Profile
|
||||
OnPropertyChanged("Port");
|
||||
}
|
||||
}
|
||||
|
||||
public string LibraryPath
|
||||
{
|
||||
get { return this._settingsService.LibraryLocation; }
|
||||
set
|
||||
{
|
||||
this._settingsService.LibraryLocation = value;
|
||||
OnPropertyChanged("LibraryPath");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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