Files
Apollon/Apollon.WPF/ViewModels/EditTournamentViewModel.cs
2022-08-18 17:49:23 +02:00

39 lines
1.3 KiB
C#

using Apollon.WPF.Commands;
using Apollon.WPF.Models;
using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Apollon.WPF.ViewModels
{
public class EditTournamentViewModel : ViewModelBase
{
public Guid TournamentId { get;}
public AddEditDetailsViewModel AddEditDetailsViewModel { get; }
public EditTournamentViewModel(ModalNavigationStore modalNavigationStore, TournamentsStore tournamentStore, Tournament tournament)
{
TournamentId = tournament.Id;
ICommand submitCommand = new EditTournamentCommand(this, tournamentStore, modalNavigationStore);
ICommand cancelCommand = new CloseModalCommand(modalNavigationStore);
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,
};
}
}
}