More progress on IoC. Controllers are implemented

This commit is contained in:
watsonb8
2020-02-02 10:26:47 -05:00
parent 48d0ffa77d
commit 8231a18c3e
54 changed files with 521 additions and 142 deletions

View File

@ -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>

View File

@ -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");
}
}
}
}

View File

@ -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