impliment NavigateService
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Apollon.Domain.Models;
|
||||
using Apollon.WPF.Services;
|
||||
using Apollon.WPF.Stores;
|
||||
using Apollon.WPF.ViewModels;
|
||||
using System;
|
||||
@@ -12,19 +13,23 @@ namespace Apollon.WPF.Commands
|
||||
public class AddTournamentCommand : AsyncCommandBase
|
||||
{
|
||||
private readonly TournamentsStore _tournamentStore;
|
||||
private readonly NavigationStore _navigationStore;
|
||||
private readonly NavigationService<PreparationViewModel> _navigationService;
|
||||
private readonly ModalNavigationStore _modalNavigationStore;
|
||||
private readonly SelectedTournamentsStore _selectedTournamentsStore;
|
||||
private AddTournamentViewModel _addTournamentViewModel;
|
||||
|
||||
|
||||
public AddTournamentCommand(AddTournamentViewModel addTournamentViewModel, TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore, NavigationStore navigationStore, SelectedTournamentsStore selectedTournamentsStore)
|
||||
public AddTournamentCommand(AddTournamentViewModel addTournamentViewModel, NavigationService<PreparationViewModel> navigationService)
|
||||
{
|
||||
}
|
||||
|
||||
public AddTournamentCommand(TournamentsStore tournamentStore, NavigationService<PreparationViewModel> navigationService, ModalNavigationStore modalNavigationStore,
|
||||
SelectedTournamentsStore selectedTournamentsStore, AddTournamentViewModel addTournamentViewModel)
|
||||
{
|
||||
_addTournamentViewModel = addTournamentViewModel;
|
||||
_tournamentStore = tournamentStore;
|
||||
_navigationService = navigationService;
|
||||
_modalNavigationStore = modalNavigationStore;
|
||||
_navigationStore = navigationStore;
|
||||
_selectedTournamentsStore = selectedTournamentsStore;
|
||||
_addTournamentViewModel = addTournamentViewModel;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object parameter)
|
||||
@@ -52,7 +57,7 @@ namespace Apollon.WPF.Commands
|
||||
await _tournamentStore.Add(tournament);
|
||||
|
||||
_modalNavigationStore.Close();
|
||||
_navigationStore.CurrentViewModel = new PreparationViewModel(_selectedTournamentsStore, _navigationStore, _modalNavigationStore, _tournamentStore);
|
||||
_navigationService.Navigate();
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
|
||||
Reference in New Issue
Block a user