impliment NavigateService

This commit is contained in:
Natlinux
2022-11-26 20:40:45 +01:00
parent 873d130aaa
commit 439850b5b7
7 changed files with 56 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
using Apollon.WPF.Commands;
using Apollon.WPF.Services;
using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
@@ -15,7 +16,7 @@ namespace Apollon.WPF.ViewModels
public AddTournamentViewModel(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore, NavigationStore navigationStore,SelectedTournamentsStore selectedTournamentsStore)
{
ICommand submitCommand = new AddTournamentCommand(this, tournamentStore,modalNavigationStore,navigationStore, selectedTournamentsStore);
ICommand submitCommand = new AddTournamentCommand(this, new NavigationService<PreparationViewModel>(navigationStore, () => new PreparationViewModel( selectedTournamentsStore, navigationStore, modalNavigationStore, tournamentStore)));
ICommand cancelCommand = new CloseModalCommand(modalNavigationStore);
AddEditDetailsViewModel = new AddEditDetailsViewModel(submitCommand, cancelCommand);
}

View File

@@ -1,5 +1,6 @@
using Apollon.Domain.Models;
using Apollon.WPF.Commands;
using Apollon.WPF.Services;
using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
@@ -35,7 +36,8 @@ namespace Apollon.WPF.ViewModels
_selectedTournamentStore.SelectedTournamentChanged += SelectedTournamentStore_SelectedTournamentChanged;
NavigateTournamentDetailsCommand = new NavigateCommand<PreparationViewModel>(navigationStore, () => new PreparationViewModel(_selectedTournamentStore,navigationStore, modalNavigationStore, tournamentsStore));
NavigateTournamentDetailsCommand = new NavigateCommand<PreparationViewModel>(new NavigationService<PreparationViewModel>(navigationStore,() => new PreparationViewModel(
selectedTournamentStore,navigationStore,modalNavigationStore, tournamentsStore)));
}
protected override void Dispose()

View File

@@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Apollon.WPF.Services;
namespace Apollon.WPF.ViewModels
{
@@ -58,7 +59,7 @@ namespace Apollon.WPF.ViewModels
LoadTournamentsCommand = new LoadTournamentsCommand(this, tournamentStore);
AddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, navigationStore, selectedTournamentStore);
NavigateNameListCommand = new NavigateCommand<NameListViewModel>(navigationStore, () => new NameListViewModel());
NavigateNameListCommand = new NavigateCommand<NameListViewModel>(new NavigationService<NameListViewModel>(navigationStore, () => new NameListViewModel()));
}

View File

@@ -1,5 +1,6 @@
using Apollon.Domain.Models;
using Apollon.WPF.Commands;
using Apollon.WPF.Services;
using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
@@ -21,7 +22,8 @@ namespace Apollon.WPF.ViewModels
{
TournamentDetailsViewModel = new TournamentDetailsViewModel(selectedTournamentStore);
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(navigationStore, () => OverviewViewModel.LoadViewModel(selectedTournamentStore, modalNavigationStore, tournamentsStore, navigationStore));
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(new NavigationService<OverviewViewModel>(navigationStore, () => OverviewViewModel.LoadViewModel(selectedTournamentStore, modalNavigationStore, tournamentsStore, navigationStore)));
}
}