Add a Tournament
This commit is contained in:
@@ -45,16 +45,21 @@ namespace Apollon.WPF.ViewModels
|
||||
_modalNavigationStore = modalNavigationStore;
|
||||
_overviewListingItemViewModels = new ObservableCollection<OverviewListingItemViewModel>();
|
||||
|
||||
//_overviewListingItemViewModels.Add(new OverviewListingItemViewModel(new Tournament("DSB", "Meisterschaft", "Halle", DateTime.Now, DateTime.Now, "Bruchsal", 10)));
|
||||
|
||||
|
||||
//AddTournament(new Tournament("DSB", "Deutschemeisterschaft1", "Halle", "01.01.2021", "05.01.2021", "Wiesbaden",3),modalNavigationStore);
|
||||
//AddTournament(new Tournament("DSB", "Deutschemeisterschaft2", "im Freien", "01.01.2021", "05.01.2021", "Berlin",5),modalNavigationStore);
|
||||
AddTournament(new Tournament("DSB", "Deutschemeisterschaft3", "Halle", DateTime.Now, DateTime.Today, "Bruchsal", 6), modalNavigationStore);
|
||||
|
||||
_tournamentStore.TournamentAdded += TournamentStore_TournamentAdded;
|
||||
}
|
||||
|
||||
private void AddTournament(Tournament tournament, ModalNavigationStore modalNavigationStore)
|
||||
protected override void Dispose()
|
||||
{
|
||||
_tournamentStore.TournamentAdded -= TournamentStore_TournamentAdded;
|
||||
|
||||
base.Dispose();
|
||||
}
|
||||
private void TournamentStore_TournamentAdded(Tournament tournament)
|
||||
{
|
||||
AddTournament(tournament);
|
||||
}
|
||||
|
||||
private void AddTournament(Tournament tournament)
|
||||
{
|
||||
// TO DO EditTournamentCommand
|
||||
_overviewListingItemViewModels.Add(new OverviewListingItemViewModel(tournament));
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Apollon.WPF.ViewModels
|
||||
public OverviewDetailsViewModel OverviewDetailsViewModel{ get; }
|
||||
|
||||
public ICommand AddTournamentCommand { get; }
|
||||
public ICommand EditTournamentCommand { get; set ; }
|
||||
public ICommand EditTournamentCommand { get;}
|
||||
|
||||
|
||||
|
||||
@@ -28,12 +28,6 @@ namespace Apollon.WPF.ViewModels
|
||||
AddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore);
|
||||
EditTournamentCommand = new OpenEditTournamentCommand(modalNavigationStore);
|
||||
|
||||
AddTournament(new Tournament("DSB", "Deutschemeisterschaft3", "Halle", DateTime.Now, DateTime.Today, "Bruchsal", 6), modalNavigationStore);
|
||||
}
|
||||
|
||||
private void AddTournament(Tournament tournament, ModalNavigationStore modalNavigationStore)
|
||||
{
|
||||
ICommand editTournamentCommand = new EditTournamentCommand(modalNavigationStore);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user