Navigation Service and Cleanup UI
This commit is contained in:
@@ -8,5 +8,11 @@ namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public class ArchersViewModel : ViewModelBase
|
||||
{
|
||||
public NavBarPreparationViewModel NavBarPreparationViewModel { get; }
|
||||
|
||||
public ArchersViewModel(NavBarPreparationViewModel navBarPreparationViewModel)
|
||||
{
|
||||
NavBarPreparationViewModel = navBarPreparationViewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,11 @@ namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public class ClassesViewModel : ViewModelBase
|
||||
{
|
||||
public NavBarPreparationViewModel NavBarPreparationViewModel { get; }
|
||||
|
||||
public ClassesViewModel(NavBarPreparationViewModel navBarPreparationViewModel)
|
||||
{
|
||||
NavBarPreparationViewModel = navBarPreparationViewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -14,13 +15,14 @@ namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
|
||||
public TournamentDetailsViewModel TournamentDetailsViewModel { get; }
|
||||
public NavBarPreparationViewModel NavBarPreparationViewModel { get; }
|
||||
public ICommand NavigateOverviewCommand { get; }
|
||||
|
||||
public GroupsViewModel(SelectedTournamentsStore selectedTournamentStore, NavigationStore navigationStore, ModalNavigationStore modalNavigationStore, TournamentsStore tournamentsStore)
|
||||
{
|
||||
{
|
||||
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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Apollon.WPF.Commands;
|
||||
using Apollon.WPF.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,7 +13,16 @@ namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public ICommand NavigateOverviewCommand { get;}
|
||||
public ICommand NavigateGroupsCommand { get;}
|
||||
public ICommand NavigateClassesCommand { get;}
|
||||
public ICommand NavigateArchersCommand { get;}
|
||||
public ICommand NavigateClassesCommand { get;}
|
||||
public ICommand NavigateArchersCommand { get;}
|
||||
|
||||
public NavBarPreparationViewModel(NavigationService<OverviewViewModel> overviewNavigationService, NavigationService<GroupsViewModel> groupNavigationService,
|
||||
NavigationService<ClassesViewModel> classNavigationService, NavigationService<ArchersViewModel> archersNavigationService)
|
||||
{
|
||||
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
|
||||
NavigateGroupsCommand = new NavigateCommand<GroupsViewModel>(groupNavigationService);
|
||||
NavigateClassesCommand = new NavigateCommand<ClassesViewModel>(classNavigationService);
|
||||
NavigateArchersCommand = new NavigateCommand<ArchersViewModel>(archersNavigationService);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
NavigatePreparationCommand = new NavigateCommand<GroupsViewModel>(navigationStore, () => new GroupsViewModel(selectedTournamentStore, navigationStore, modalNavigationStore, tournamentsStore));
|
||||
NavigatePreparationCommand = new NavigateCommand<GroupsViewModel>(new NavigationService<GroupsViewModel> (
|
||||
navigationStore, () => new GroupsViewModel( _selectedTournamentStore, navigationStore, modalNavigationStore, tournamentsStore)));
|
||||
}
|
||||
|
||||
protected override void Dispose()
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
using Apollon.WPF.Commands;
|
||||
using Apollon.Domain.Models;
|
||||
using Apollon.WPF.Stores;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using Apollon.WPF.Services;
|
||||
|
||||
namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
@@ -58,7 +53,8 @@ namespace Apollon.WPF.ViewModels
|
||||
|
||||
LoadTournamentsCommand = new LoadTournamentsCommand(this, tournamentStore);
|
||||
OpenAddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, navigationStore, selectedTournamentStore);
|
||||
NavigateNameListCommand = new NavigateCommand<NameListViewModel>(navigationStore, () => new NameListViewModel());
|
||||
NavigateNameListCommand = new NavigateCommand<NameListViewModel>(new NavigationService<NameListViewModel>(
|
||||
navigationStore, () => new NameListViewModel()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user