112 lines
2.7 KiB
C#
112 lines
2.7 KiB
C#
using System.Threading.Tasks;
|
|
using Aurora.Design.Views.Party.NewPartyDialog;
|
|
using Xamarin.Forms;
|
|
using Aurora.Services.Server;
|
|
using Aurora.Services.EventManager;
|
|
using Aurora.Services.Settings;
|
|
|
|
namespace Aurora.Design.Views.Party
|
|
{
|
|
public class HostPartyViewModel : BasePartyViewModel
|
|
{
|
|
private IServerService _serverService;
|
|
private IEventManager _eventManager;
|
|
public HostPartyViewModel(
|
|
ISettingsService settingsService,
|
|
IServerService serverService,
|
|
IEventManager eventManager
|
|
): base(settingsService)
|
|
{
|
|
this._serverService = serverService;
|
|
this._eventManager = eventManager;
|
|
}
|
|
|
|
#region Properties
|
|
|
|
/// <summary>
|
|
/// Public property for playing media command
|
|
/// </summary>
|
|
/// <value></value>
|
|
public Command PlayCommand { get; private set; }
|
|
|
|
/// <summary>
|
|
/// Public property for leave party command
|
|
/// </summary>
|
|
/// <value></value>
|
|
public Command LeavePartyCommand { get; private set; }
|
|
|
|
#endregion Properties
|
|
|
|
/// <summary>
|
|
/// Called by framework when view becomes active
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public override Task OnActive()
|
|
{
|
|
|
|
return Task.FromResult<object>(null);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Called by framework when view becomes inactive
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public override Task OnInactive()
|
|
{
|
|
return Task.FromResult<object>(null);
|
|
}
|
|
|
|
private async void OnHostCommandExecute()
|
|
{
|
|
|
|
}
|
|
|
|
private bool CanHostCommandExecute()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
private async void OnLeavePartyCommandExecute()
|
|
{
|
|
|
|
}
|
|
|
|
private bool CanLeavePartyCommandExecute()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public override void OnPlayButtonCommandExecute()
|
|
{
|
|
|
|
}
|
|
|
|
public override bool CanPlayButtonCommandExecute()
|
|
{
|
|
return this.State == PartyStateV2.Hosting;
|
|
}
|
|
|
|
public override bool CanNextButtonCommandExecute()
|
|
{
|
|
return this.State == PartyStateV2.Hosting;
|
|
}
|
|
|
|
public override bool CanPreviousButtonCommandExecute()
|
|
{
|
|
return this.State == PartyStateV2.Hosting;
|
|
}
|
|
|
|
/// <summary>
|
|
/// On double click execute, fire media playing event
|
|
/// </summary>
|
|
public void OnDoubleClickCommandExecute()
|
|
{
|
|
}
|
|
|
|
public bool CanDoubleClickCommandExecute()
|
|
{
|
|
return this.State == PartyStateV2.Hosting;
|
|
}
|
|
|
|
}
|
|
} |