using System;
using System.ComponentModel;
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
///
/// Command event handler for player play button
///
public virtual void OnPlayButtonExecute() { }
public virtual bool CanPlayButtonExecute()
{
return true;
}
///
/// Command event handler for player next button
///
public virtual void OnNextButtonExecute() { }
public virtual bool CanNextButtonExecute()
{
return true;
}
///
/// Command event handler for player previous button
///
public virtual void OnPreviousButtonExecute() { }
public virtual bool CanPreviousButtonExecute()
{
return true;
}
///
/// Model for the currently playing music.
///
///
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; }
public SetPlayerVisibleDelegate SetPlayerVisible { get; set; }
#endregion Player
#region Lifecycle
public virtual Task OnActive() { return Task.FromResult