Renavigate

This commit is contained in:
Natlinux81
2022-08-29 20:46:22 +02:00
parent bbf1e21fdf
commit a655efdc8c
6 changed files with 17 additions and 22 deletions

View File

@@ -12,20 +12,16 @@ namespace Apollon.WPF.Commands
public class AddTournamentCommand : AsyncCommandBase
{
private readonly TournamentsStore _tournamentStore;
private readonly NavigationStore _navigationStore;
private readonly ModalNavigationStore _modalNavigationStore;
private AddTournamentViewModel _addTournamentViewModel;
private AddTournamentViewModel _addTournamentViewModel;
public AddTournamentCommand(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore)
{
_tournamentStore = tournamentStore;
_modalNavigationStore = modalNavigationStore;
}
public AddTournamentCommand(AddTournamentViewModel addTournamentViewModel, TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore)
public AddTournamentCommand(AddTournamentViewModel addTournamentViewModel, TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore, NavigationStore navigationStore)
{
_addTournamentViewModel = addTournamentViewModel;
_tournamentStore = tournamentStore;
_modalNavigationStore = modalNavigationStore;
_navigationStore = navigationStore;
}
public override async Task ExecuteAsync(object parameter)
@@ -50,6 +46,7 @@ namespace Apollon.WPF.Commands
await _tournamentStore.Add(tournament);
_modalNavigationStore.Close();
_navigationStore.CurrentViewModel = new NavBarViewModel(_navigationStore);
}
catch (Exception)