create layout
This commit is contained in:
@@ -12,15 +12,14 @@ namespace Apollon.WPF.Commands
|
||||
private readonly TournamentsStore _tournamentStore;
|
||||
private readonly ModalNavigationStore _modalNavigationStore;
|
||||
private AddTournamentViewModel _addTournamentViewModel;
|
||||
private readonly NavigationService<GroupsViewModel> _navigationService;
|
||||
|
||||
|
||||
|
||||
public AddTournamentCommand(AddTournamentViewModel addTournamentViewModel, TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore, NavigationService<GroupsViewModel> navigationService)
|
||||
public AddTournamentCommand(AddTournamentViewModel addTournamentViewModel, TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore)
|
||||
{
|
||||
_addTournamentViewModel = addTournamentViewModel;
|
||||
_tournamentStore = tournamentStore;
|
||||
_modalNavigationStore = modalNavigationStore;
|
||||
_navigationService = navigationService;
|
||||
_modalNavigationStore = modalNavigationStore;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object parameter)
|
||||
@@ -48,7 +47,7 @@ namespace Apollon.WPF.Commands
|
||||
await _tournamentStore.Add(tournament);
|
||||
|
||||
_modalNavigationStore.Close();
|
||||
_navigationService.Navigate();
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace Apollon.WPF.Commands
|
||||
public class NavigateCommand<TViewModel> : CommandBase
|
||||
where TViewModel : ViewModelBase
|
||||
{
|
||||
private readonly NavigationService<TViewModel> _navigationService;
|
||||
private readonly INavigationService<TViewModel> _navigationService;
|
||||
|
||||
public NavigateCommand(NavigationService<TViewModel> navigationService)
|
||||
public NavigateCommand(INavigationService<TViewModel> navigationService)
|
||||
{
|
||||
_navigationService = navigationService;
|
||||
}
|
||||
|
||||
@@ -12,19 +12,18 @@ namespace Apollon.WPF.Commands
|
||||
public class OpenAddTournamentCommand : CommandBase
|
||||
{
|
||||
private readonly TournamentsStore _tournamentStore;
|
||||
private readonly ModalNavigationStore _modalNavigationStore;
|
||||
private readonly NavigationService<GroupsViewModel> _navigationService;
|
||||
private readonly ModalNavigationStore _modalNavigationStore;
|
||||
|
||||
public OpenAddTournamentCommand(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore, NavigationService<GroupsViewModel> navigationService)
|
||||
public OpenAddTournamentCommand(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore)
|
||||
{
|
||||
_tournamentStore = tournamentStore;
|
||||
_modalNavigationStore = modalNavigationStore;
|
||||
_navigationService = navigationService;
|
||||
;
|
||||
}
|
||||
|
||||
public override void Execute(object parameter)
|
||||
{
|
||||
AddTournamentViewModel addTournamentViewModel = new AddTournamentViewModel(_tournamentStore, _modalNavigationStore, _navigationService);
|
||||
AddTournamentViewModel addTournamentViewModel = new AddTournamentViewModel(_tournamentStore, _modalNavigationStore);
|
||||
_modalNavigationStore.CurrentViewModel = addTournamentViewModel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user