The TournamentViewer is quite ready, just the score-handling is left to wire up

This commit is contained in:
2020-05-18 23:44:18 +02:00
parent 1207617a7c
commit 8040d47acb
5 changed files with 322 additions and 4 deletions

View File

@ -29,13 +29,23 @@ namespace TrackerWPFUI.ViewModels
ActivateItem(new CreateTournamentViewModel());
}
public void LoadTournament()
{
if (SelectedTournament !=null && !string.IsNullOrWhiteSpace(SelectedTournament.TournamentName))
{
ActivateItem(new TournamentViewerViewModel(SelectedTournament));
}
}
public void Handle(TournamentModel message)
{
// Open the tournamentViewer to the given tournament
throw new NotImplementedException();
ExistingTournaments.Add(message);
SelectedTournament = message;
}
private BindableCollection<TournamentModel> _existingTournaments;
private TournamentModel _SelectedTournament;
public BindableCollection<TournamentModel> ExistingTournaments
{
@ -43,7 +53,6 @@ namespace TrackerWPFUI.ViewModels
set { _existingTournaments = value; }
}
private TournamentModel _SelectedTournament;
public TournamentModel SelectedTournament
{
@ -52,9 +61,8 @@ namespace TrackerWPFUI.ViewModels
{
_SelectedTournament = value;
NotifyOfPropertyChange(() => SelectedTournament);
LoadTournament();
}
}
}
}