Working player contained within main page and control delegated to viewmodels
This commit is contained in:
@ -4,44 +4,71 @@ using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
using Aurora.Models.Media;
|
||||
using Xamarin.Forms;
|
||||
using Aurora.Design.Views.Main;
|
||||
|
||||
namespace Aurora.Design.Views
|
||||
{
|
||||
|
||||
public class BaseViewModel : INotifyPropertyChanged
|
||||
{
|
||||
private BaseMedia _baseMedia;
|
||||
public BaseViewModel()
|
||||
{
|
||||
}
|
||||
|
||||
#region Player
|
||||
public virtual void PlayExecute()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual bool PlayCanExecute()
|
||||
/// <summary>
|
||||
/// Command event handler for player play button
|
||||
/// </summary>
|
||||
public virtual void OnPlayExecute() { }
|
||||
public virtual bool CanPlayExecute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void NextExecute()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual bool NextCanExecute()
|
||||
/// <summary>
|
||||
/// Command event handler for player next button
|
||||
/// </summary>
|
||||
public virtual void OnNextExecute() { }
|
||||
public virtual bool CanNextExecute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void PreviousExecute()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual bool PreviousCanExecute()
|
||||
/// <summary>
|
||||
/// Command event handler for player previous button
|
||||
/// </summary>
|
||||
public virtual void OnPreviousExecute() { }
|
||||
public virtual bool CanPreviousExecute()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public BaseMedia Media { get; set; }
|
||||
/// <summary>
|
||||
/// Model for the currently playing music.
|
||||
/// </summary>
|
||||
/// <value></value>
|
||||
public BaseMedia Media
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._baseMedia;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != _baseMedia)
|
||||
{
|
||||
_baseMedia = value;
|
||||
if (this.SetPlayerMetadata != null)
|
||||
{
|
||||
SetPlayerMetadata.Invoke(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public SetPlayerMetadataDelegate SetPlayerMetadata { get; set; }
|
||||
|
||||
#endregion Player
|
||||
|
||||
|
Reference in New Issue
Block a user