refill not works

This commit is contained in:
Natlinux81
2022-08-18 01:10:52 +02:00
parent 5f93b56b8e
commit b40ef92e4b
5 changed files with 25 additions and 40 deletions

View File

@@ -14,20 +14,12 @@ namespace Apollon.WPF.ViewModels
{
public AddEditDetailsViewModel AddEditDetailsViewModel { get; }
public EditTournamentViewModel(ModalNavigationStore modalNavigationStore, Tournament tournament)
public EditTournamentViewModel(ModalNavigationStore modalNavigationStore)
{
ICommand submitCommand = new EditTournamentCommand(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,
};
AddEditDetailsViewModel = new AddEditDetailsViewModel(submitCommand, cancelCommand);
}
}
}

View File

@@ -45,34 +45,19 @@ namespace Apollon.WPF.ViewModels
_modalNavigationStore = modalNavigationStore;
_overviewListingItemViewModels = new ObservableCollection<OverviewListingItemViewModel>();
_tournamentStore.TournamentAdded += _tournamentStore_TournamentAdded;
//_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", "01.01.2021", "05.01.2021", "Bruchsal", 6),modalNavigationStore);
AddTournament(new Tournament("DSB", "Deutschemeisterschaft3", "Halle", DateTime.Now, DateTime.Today, "Bruchsal", 6), modalNavigationStore);
}
protected override void Dispose()
private void AddTournament(Tournament tournament, ModalNavigationStore modalNavigationStore)
{
_tournamentStore.TournamentAdded -= _tournamentStore_TournamentAdded;
base.Dispose();
}
private void _tournamentStore_TournamentAdded(Tournament tournament)
{
AddTournament(tournament);
}
private void AddTournament(Tournament tournament)
{
//ICommand editTournamentCommand = new OpenEditTournamentCommand(_modalNavigationStore);
_overviewListingItemViewModels.Add(new OverviewListingItemViewModel(tournament
//,editTournamentCommand
));
// TO DO EditTournamentCommand
_overviewListingItemViewModels.Add(new OverviewListingItemViewModel(tournament));
}
}
}

View File

@@ -16,7 +16,7 @@ namespace Apollon.WPF.ViewModels
public OverviewDetailsViewModel OverviewDetailsViewModel{ get; }
public ICommand AddTournamentCommand { get; }
public ICommand EditTournamentCommand { get; }
public ICommand EditTournamentCommand { get; set ; }
@@ -26,7 +26,15 @@ namespace Apollon.WPF.ViewModels
OverviewDetailsViewModel = new OverviewDetailsViewModel(selectedTournamentStore);
AddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore);
//EditTournamentCommand = new OpenEditTournamentCommand(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);
}
}
}