Added variables to home page for calling competition overlay.
This commit is contained in:
@@ -3,10 +3,52 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace osrs_toolbox
|
namespace osrs_toolbox
|
||||||
{
|
{
|
||||||
public abstract class HomePageModel : ModelBase
|
public abstract class HomePageModel : ModelBase
|
||||||
{
|
{
|
||||||
|
private int _competitionId = -1;
|
||||||
|
private int _groupId = -1;
|
||||||
|
private string _playerName = string.Empty;
|
||||||
|
private bool _hideOtherPlayers = false;
|
||||||
|
private bool _hideZeroKC = false;
|
||||||
|
|
||||||
|
private ICommand _toggleCompetitionOverlay;
|
||||||
|
|
||||||
|
public int CompetitionID
|
||||||
|
{
|
||||||
|
get { return _competitionId; }
|
||||||
|
set { SetProperty(ref _competitionId, value, nameof(CompetitionID)); }
|
||||||
|
}
|
||||||
|
public int GroupID
|
||||||
|
{
|
||||||
|
get { return _groupId; }
|
||||||
|
set { SetProperty(ref _groupId, value, nameof(GroupID)); }
|
||||||
|
}
|
||||||
|
public string PlayerName
|
||||||
|
{
|
||||||
|
get { return _playerName; }
|
||||||
|
set { SetProperty(ref _playerName, value, nameof(PlayerName)); }
|
||||||
|
}
|
||||||
|
public bool HideOtherPlayers
|
||||||
|
{
|
||||||
|
get { return _hideOtherPlayers; }
|
||||||
|
set { SetProperty(ref _hideOtherPlayers, value, nameof(HideOtherPlayers)); }
|
||||||
|
}
|
||||||
|
public bool HideZeroKC
|
||||||
|
{
|
||||||
|
get { return _hideZeroKC; }
|
||||||
|
set { SetProperty(ref _hideZeroKC, value, nameof(HideZeroKC)); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand ToggleCompetitionOverlay
|
||||||
|
{
|
||||||
|
get { return _toggleCompetitionOverlay; }
|
||||||
|
set { SetProperty(ref _toggleCompetitionOverlay, value, nameof(ToggleCompetitionOverlay)); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -16,12 +16,26 @@ namespace osrs_toolbox
|
|||||||
|
|
||||||
private void InitializeVariables()
|
private void InitializeVariables()
|
||||||
{
|
{
|
||||||
|
CompetitionID = -1;
|
||||||
|
GroupID = -1;
|
||||||
|
PlayerName = string.Empty;
|
||||||
|
HideOtherPlayers = false;
|
||||||
|
HideZeroKC = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitializeCommands()
|
private void InitializeCommands()
|
||||||
{
|
{
|
||||||
|
ToggleCompetitionOverlay = new RelayCommand(DoToggleCompetitionOverlay);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DoToggleCompetitionOverlay(object obj)
|
||||||
|
{
|
||||||
|
if (CompetitionOverlayView.Current != null)
|
||||||
|
CompetitionOverlayView.Current.Close();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CompetitionOverlayView cov = new CompetitionOverlayView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user