create layout
This commit is contained in:
@@ -14,9 +14,9 @@ namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public AddEditDetailsViewModel AddEditDetailsViewModel { get; }
|
||||
|
||||
public AddTournamentViewModel(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore, NavigationService<GroupsViewModel> navigationService)
|
||||
public AddTournamentViewModel(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore)
|
||||
{
|
||||
ICommand submitCommand = new AddTournamentCommand(this, tournamentStore,modalNavigationStore, navigationService);
|
||||
ICommand submitCommand = new AddTournamentCommand(this, tournamentStore,modalNavigationStore);
|
||||
ICommand cancelCommand = new CloseModalCommand(modalNavigationStore);
|
||||
AddEditDetailsViewModel = new AddEditDetailsViewModel(submitCommand, cancelCommand);
|
||||
}
|
||||
|
||||
@@ -9,13 +9,6 @@ namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public class ArchersViewModel : ViewModelBase
|
||||
{
|
||||
public TournamentDetailsViewModel TournamentDetailsViewModel { get; }
|
||||
public NavBarPreparationViewModel NavBarPreparationViewModel { get; }
|
||||
|
||||
public ArchersViewModel(NavBarPreparationViewModel navBarPreparationViewModel, SelectedTournamentsStore selectedTournamentsStore)
|
||||
{
|
||||
TournamentDetailsViewModel = new TournamentDetailsViewModel(selectedTournamentsStore);
|
||||
NavBarPreparationViewModel = navBarPreparationViewModel;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,6 @@ namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public class ClassesViewModel : ViewModelBase
|
||||
{
|
||||
public TournamentDetailsViewModel TournamentDetailsViewModel { get; }
|
||||
public NavBarPreparationViewModel NavBarPreparationViewModel { get; }
|
||||
|
||||
public ClassesViewModel(NavBarPreparationViewModel navBarPreparationViewModel, SelectedTournamentsStore selectedTournamentsStore)
|
||||
{
|
||||
TournamentDetailsViewModel = new TournamentDetailsViewModel(selectedTournamentsStore);
|
||||
NavBarPreparationViewModel = navBarPreparationViewModel;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,19 +12,12 @@ using System.Windows.Input;
|
||||
namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public class GroupsViewModel : ViewModelBase
|
||||
{
|
||||
|
||||
public TournamentDetailsViewModel TournamentDetailsViewModel { get; }
|
||||
public NavBarPreparationViewModel NavBarPreparationViewModel { get; }
|
||||
{
|
||||
public ICommand NavigateOverviewCommand { get; }
|
||||
|
||||
public GroupsViewModel(NavBarPreparationViewModel navBarPreparationViewModel, SelectedTournamentsStore selectedTournamentStore, NavigationService<OverviewViewModel> overviewNavigationService)
|
||||
{
|
||||
TournamentDetailsViewModel = new TournamentDetailsViewModel(selectedTournamentStore);
|
||||
|
||||
NavBarPreparationViewModel = navBarPreparationViewModel;
|
||||
|
||||
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
|
||||
public GroupsViewModel(INavigationService<OverviewViewModel> overviewNavigationService)
|
||||
{
|
||||
//NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
Apollon.WPF/ViewModels/LayoutViewModel.cs
Normal file
20
Apollon.WPF/ViewModels/LayoutViewModel.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public class LayoutViewModel : ViewModelBase
|
||||
{
|
||||
public LayoutViewModel(NavBarPreparationViewModel navBarPreparationViewModel, ViewModelBase contentVieModel)
|
||||
{
|
||||
NavBarPreparationViewModel = navBarPreparationViewModel;
|
||||
ContentVieModel = contentVieModel;
|
||||
}
|
||||
|
||||
public NavBarPreparationViewModel NavBarPreparationViewModel { get;}
|
||||
public ViewModelBase ContentVieModel { get;}
|
||||
}
|
||||
}
|
||||
@@ -17,11 +17,11 @@ namespace Apollon.WPF.ViewModels
|
||||
public ICommand NavigateNamelistCommand { get;}
|
||||
public ICommand NavigateArchersCommand { get;}
|
||||
|
||||
public NavBarPreparationViewModel(NavigationService<OverviewViewModel> overviewNavigationService,
|
||||
NavigationService<GroupsViewModel> groupNavigationService,
|
||||
NavigationService<NameListViewModel> namelistNavigationService,
|
||||
NavigationService<ClassesViewModel> classNavigationService,
|
||||
NavigationService<ArchersViewModel> archersNavigationService)
|
||||
public NavBarPreparationViewModel(INavigationService<OverviewViewModel> overviewNavigationService,
|
||||
INavigationService<GroupsViewModel> groupNavigationService,
|
||||
INavigationService<NameListViewModel> namelistNavigationService,
|
||||
INavigationService<ClassesViewModel> classNavigationService,
|
||||
INavigationService<ArchersViewModel> archersNavigationService)
|
||||
{
|
||||
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
|
||||
NavigateGroupsCommand = new NavigateCommand<GroupsViewModel>(groupNavigationService);
|
||||
|
||||
@@ -24,15 +24,17 @@ namespace Apollon.WPF.ViewModels
|
||||
public int Targets => SelectedTournament?.Targets ?? 0;
|
||||
|
||||
public ICommand NavigatePreparationCommand { get; }
|
||||
public SelectedTournamentsStore SelectedTournamentStore { get; }
|
||||
|
||||
|
||||
public OverviewDetailsViewModel(SelectedTournamentsStore selectedTournamentStore, NavigationService<GroupsViewModel> groupNavigationService)
|
||||
public OverviewDetailsViewModel(SelectedTournamentsStore selectedTournamentStore, INavigationService<GroupsViewModel> groupNavigationService)
|
||||
{
|
||||
_selectedTournamentStore = selectedTournamentStore;
|
||||
|
||||
_selectedTournamentStore.SelectedTournamentChanged += SelectedTournamentStore_SelectedTournamentChanged;
|
||||
|
||||
NavigatePreparationCommand = new NavigateCommand<GroupsViewModel>(groupNavigationService);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose()
|
||||
{
|
||||
|
||||
@@ -46,24 +46,24 @@ namespace Apollon.WPF.ViewModels
|
||||
public ICommand NavigateNameListCommand { get; }
|
||||
|
||||
public OverviewViewModel(TournamentsStore tournamentStore, SelectedTournamentsStore selectedTournamentStore,
|
||||
ModalNavigationStore modalNavigationStore, NavigationService<GroupsViewModel> groupNavigationService, NavigationService<NameListViewModel> NameListNavigationService)
|
||||
ModalNavigationStore modalNavigationStore, INavigationService<NameListViewModel> NameListNavigationService, INavigationService<GroupsViewModel> groupNavigationService)
|
||||
{
|
||||
OverviewListingViewModel = new OverviewListingViewModel(selectedTournamentStore, modalNavigationStore, tournamentStore);
|
||||
OverviewDetailsViewModel = new OverviewDetailsViewModel(selectedTournamentStore ,groupNavigationService);
|
||||
OverviewDetailsViewModel = new OverviewDetailsViewModel(selectedTournamentStore, groupNavigationService);
|
||||
|
||||
LoadTournamentsCommand = new LoadTournamentsCommand(this, tournamentStore);
|
||||
OpenAddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, groupNavigationService);
|
||||
OpenAddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore);
|
||||
NavigateNameListCommand = new NavigateCommand<NameListViewModel>(NameListNavigationService);
|
||||
|
||||
}
|
||||
|
||||
public static OverviewViewModel LoadViewModel(SelectedTournamentsStore selectedTournamentStore,
|
||||
ModalNavigationStore modalNavigationStore,
|
||||
TournamentsStore tournamentStore,
|
||||
NavigationService<GroupsViewModel> groupNavigationService,
|
||||
NavigationService<NameListViewModel> NameListNavigationService)
|
||||
TournamentsStore tournamentStore,
|
||||
INavigationService<NameListViewModel> NameListNavigationService,
|
||||
INavigationService<GroupsViewModel> groupNavigationService)
|
||||
{
|
||||
OverviewViewModel viewModel = new OverviewViewModel(tournamentStore, selectedTournamentStore, modalNavigationStore,groupNavigationService, NameListNavigationService);
|
||||
OverviewViewModel viewModel = new OverviewViewModel(tournamentStore, selectedTournamentStore, modalNavigationStore, NameListNavigationService, groupNavigationService);
|
||||
|
||||
viewModel.LoadTournamentsCommand.Execute(null);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user