See commit description for changes
Added PageContainer to dynamically load pages within the main content. Added player component to control music playback(Half functional). Added playback changed event not the player service.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:songs="clr-namespace:Aurora.Frontend.Views.Songs"
|
||||
xmlns:dg="clr-namespace:Xamarin.Forms.DataGrid;assembly=Xamarin.Forms.DataGrid"
|
||||
@ -47,4 +47,4 @@
|
||||
|
||||
</dg:DataGrid>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
||||
</ContentView>
|
||||
|
@ -5,7 +5,7 @@ using Xamarin.Forms;
|
||||
|
||||
namespace Aurora.Frontend.Views.Songs
|
||||
{
|
||||
public partial class SongsView : ContentPage
|
||||
public partial class SongsView : ContentView
|
||||
{
|
||||
public SongsView()
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Aurora.Backend.Models;
|
||||
using Aurora.Backend.Services;
|
||||
using Aurora.Backend.Services.PlayerService;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Aurora.Frontend.Views.Songs
|
||||
@ -8,15 +9,15 @@ namespace Aurora.Frontend.Views.Songs
|
||||
public class SongsViewModel : BaseViewModel
|
||||
{
|
||||
#region Fields
|
||||
private ObservableCollection<BaseSong> _songsList;
|
||||
private BaseSong _selectedSong;
|
||||
private ObservableCollection<BaseMedia> _songsList;
|
||||
private BaseMedia _selectedSong;
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Constructor
|
||||
public SongsViewModel()
|
||||
{
|
||||
_songsList = new ObservableCollection<BaseSong>();
|
||||
_songsList = new ObservableCollection<BaseMedia>();
|
||||
PlayCommand = new Command(PlayExecute);
|
||||
Initialize();
|
||||
}
|
||||
@ -24,13 +25,13 @@ namespace Aurora.Frontend.Views.Songs
|
||||
#endregion Constructor
|
||||
|
||||
#region Properties
|
||||
public ObservableCollection<BaseSong> SongsList
|
||||
public ObservableCollection<BaseMedia> SongsList
|
||||
{
|
||||
get { return _songsList; }
|
||||
set { SetProperty(ref _songsList, value); }
|
||||
}
|
||||
|
||||
public BaseSong SelectedSong
|
||||
public BaseMedia SelectedSong
|
||||
{
|
||||
get { return _selectedSong; }
|
||||
set { SetProperty(ref _selectedSong, value); }
|
||||
@ -49,7 +50,8 @@ namespace Aurora.Frontend.Views.Songs
|
||||
|
||||
public void PlayExecute()
|
||||
{
|
||||
PlayerService.Instance.Play(_selectedSong);
|
||||
PlayerService.Instance.LoadMedia(_selectedSong);
|
||||
PlayerService.Instance.Play();
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
Reference in New Issue
Block a user