Edit Function are available

This commit is contained in:
Natlinux81
2022-08-18 17:49:23 +02:00
parent 99c3bd58e1
commit 44e2e17c15
17 changed files with 203 additions and 100 deletions

View File

@@ -12,13 +12,26 @@ namespace Apollon.WPF.ViewModels
{
public class EditTournamentViewModel : ViewModelBase
{
public Guid TournamentId { get;}
public AddEditDetailsViewModel AddEditDetailsViewModel { get; }
public EditTournamentViewModel(ModalNavigationStore modalNavigationStore)
public EditTournamentViewModel(ModalNavigationStore modalNavigationStore, TournamentsStore tournamentStore, Tournament tournament)
{
ICommand submitCommand = new EditTournamentCommand(modalNavigationStore);
TournamentId = tournament.Id;
ICommand submitCommand = new EditTournamentCommand(this, tournamentStore, modalNavigationStore);
ICommand cancelCommand = new CloseModalCommand(modalNavigationStore);
AddEditDetailsViewModel = new AddEditDetailsViewModel(submitCommand, cancelCommand);
AddEditDetailsViewModel = new AddEditDetailsViewModel(submitCommand, cancelCommand)
{
Organisation = tournament.Organisation,
TournamentName = tournament.TournamentName,
Competition = tournament.Competition,
StartDate = tournament.StartDate,
EndDate = tournament.EndDate,
Location = tournament.Location,
Rounds = tournament.Rounds,
};
}
}