create layout
This commit is contained in:
@@ -39,11 +39,7 @@ namespace Apollon.WPF
|
|||||||
_tournamentStore = new TournamentsStore(_getAllTournamentQuery, _createTournamentCommand, _updateTournamentCommand, _deleteTournamentCommand);
|
_tournamentStore = new TournamentsStore(_getAllTournamentQuery, _createTournamentCommand, _updateTournamentCommand, _deleteTournamentCommand);
|
||||||
_selectedTournamentStore = new SelectedTournamentsStore(_tournamentStore);
|
_selectedTournamentStore = new SelectedTournamentsStore(_tournamentStore);
|
||||||
|
|
||||||
_navBarPreparationViewModel = new NavBarPreparationViewModel(CreateOverviewNavigationService(),
|
_navBarPreparationViewModel = CreateNavbarViewModel();
|
||||||
CreateGroupsNavigationService(),
|
|
||||||
CreateNamelistNavigationService(),
|
|
||||||
CreateClassesNavigationService(),
|
|
||||||
CreateArchersNavigationService());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnStartup(StartupEventArgs e)
|
protected override void OnStartup(StartupEventArgs e)
|
||||||
@@ -57,10 +53,10 @@ namespace Apollon.WPF
|
|||||||
_selectedTournamentStore,
|
_selectedTournamentStore,
|
||||||
_modalNavigationStore,
|
_modalNavigationStore,
|
||||||
_tournamentStore,
|
_tournamentStore,
|
||||||
CreateGroupsNavigationService(),
|
CreateNamelistNavigationService(),
|
||||||
CreateNamelistNavigationService());
|
CreateGroupsNavigationService());
|
||||||
|
|
||||||
NavigationService<OverviewViewModel> overvoewNavigationService = CreateOverviewNavigationService();
|
INavigationService<OverviewViewModel> overvoewNavigationService = CreateOverviewNavigationService();
|
||||||
overvoewNavigationService.Navigate();
|
overvoewNavigationService.Navigate();
|
||||||
|
|
||||||
MainWindow = new MainWindow()
|
MainWindow = new MainWindow()
|
||||||
@@ -72,34 +68,47 @@ namespace Apollon.WPF
|
|||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private NavigationService<OverviewViewModel> CreateOverviewNavigationService()
|
private INavigationService<OverviewViewModel> CreateOverviewNavigationService()
|
||||||
{
|
{
|
||||||
return new NavigationService<OverviewViewModel>(
|
return new NavigationService<OverviewViewModel>(
|
||||||
_navigationStore, () => OverviewViewModel.LoadViewModel(_selectedTournamentStore, _modalNavigationStore, _tournamentStore, CreateGroupsNavigationService(), CreateNamelistNavigationService()));
|
_navigationStore, () => OverviewViewModel.LoadViewModel(_selectedTournamentStore,
|
||||||
|
_modalNavigationStore,
|
||||||
|
_tournamentStore,
|
||||||
|
CreateNamelistNavigationService(),
|
||||||
|
CreateGroupsNavigationService()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private NavigationService<GroupsViewModel> CreateGroupsNavigationService()
|
private NavBarPreparationViewModel CreateNavbarViewModel()
|
||||||
{
|
{
|
||||||
return new NavigationService<GroupsViewModel>(
|
return new NavBarPreparationViewModel(CreateOverviewNavigationService(),
|
||||||
_navigationStore, () => new GroupsViewModel(_navBarPreparationViewModel, _selectedTournamentStore, CreateOverviewNavigationService()));
|
CreateGroupsNavigationService(),
|
||||||
|
CreateNamelistNavigationService(),
|
||||||
|
CreateClassesNavigationService(),
|
||||||
|
CreateArchersNavigationService());
|
||||||
}
|
}
|
||||||
|
|
||||||
private NavigationService<ClassesViewModel> CreateClassesNavigationService()
|
private INavigationService<GroupsViewModel> CreateGroupsNavigationService()
|
||||||
{
|
{
|
||||||
return new NavigationService<ClassesViewModel>(
|
return new LayoutNavigationService<GroupsViewModel>(
|
||||||
_navigationStore, ()=> new ClassesViewModel(_navBarPreparationViewModel, _selectedTournamentStore));
|
_navigationStore, () => new GroupsViewModel(CreateOverviewNavigationService()), CreateNavbarViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private NavigationService<NameListViewModel> CreateNamelistNavigationService()
|
private INavigationService<ClassesViewModel> CreateClassesNavigationService()
|
||||||
{
|
{
|
||||||
return new NavigationService<NameListViewModel>(
|
return new LayoutNavigationService<ClassesViewModel>(
|
||||||
_navigationStore, () => new NameListViewModel());
|
_navigationStore, ()=> new ClassesViewModel(), CreateNavbarViewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private NavigationService<ArchersViewModel> CreateArchersNavigationService()
|
private INavigationService<NameListViewModel> CreateNamelistNavigationService()
|
||||||
{
|
{
|
||||||
return new NavigationService<ArchersViewModel>(
|
return new LayoutNavigationService<NameListViewModel>(
|
||||||
_navigationStore, () => new ArchersViewModel(_navBarPreparationViewModel, _selectedTournamentStore));
|
_navigationStore, () => new NameListViewModel(), CreateNavbarViewModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
private INavigationService<ArchersViewModel> CreateArchersNavigationService()
|
||||||
|
{
|
||||||
|
return new LayoutNavigationService<ArchersViewModel>(
|
||||||
|
_navigationStore, () => new ArchersViewModel(), CreateNavbarViewModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,15 +12,14 @@ namespace Apollon.WPF.Commands
|
|||||||
private readonly TournamentsStore _tournamentStore;
|
private readonly TournamentsStore _tournamentStore;
|
||||||
private readonly ModalNavigationStore _modalNavigationStore;
|
private readonly ModalNavigationStore _modalNavigationStore;
|
||||||
private AddTournamentViewModel _addTournamentViewModel;
|
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;
|
_addTournamentViewModel = addTournamentViewModel;
|
||||||
_tournamentStore = tournamentStore;
|
_tournamentStore = tournamentStore;
|
||||||
_modalNavigationStore = modalNavigationStore;
|
_modalNavigationStore = modalNavigationStore;
|
||||||
_navigationService = navigationService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override async Task ExecuteAsync(object parameter)
|
public override async Task ExecuteAsync(object parameter)
|
||||||
@@ -48,7 +47,7 @@ namespace Apollon.WPF.Commands
|
|||||||
await _tournamentStore.Add(tournament);
|
await _tournamentStore.Add(tournament);
|
||||||
|
|
||||||
_modalNavigationStore.Close();
|
_modalNavigationStore.Close();
|
||||||
_navigationService.Navigate();
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ namespace Apollon.WPF.Commands
|
|||||||
public class NavigateCommand<TViewModel> : CommandBase
|
public class NavigateCommand<TViewModel> : CommandBase
|
||||||
where TViewModel : ViewModelBase
|
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;
|
_navigationService = navigationService;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,18 +13,17 @@ namespace Apollon.WPF.Commands
|
|||||||
{
|
{
|
||||||
private readonly TournamentsStore _tournamentStore;
|
private readonly TournamentsStore _tournamentStore;
|
||||||
private readonly ModalNavigationStore _modalNavigationStore;
|
private readonly ModalNavigationStore _modalNavigationStore;
|
||||||
private readonly NavigationService<GroupsViewModel> _navigationService;
|
|
||||||
|
|
||||||
public OpenAddTournamentCommand(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore, NavigationService<GroupsViewModel> navigationService)
|
public OpenAddTournamentCommand(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore)
|
||||||
{
|
{
|
||||||
_tournamentStore = tournamentStore;
|
_tournamentStore = tournamentStore;
|
||||||
_modalNavigationStore = modalNavigationStore;
|
_modalNavigationStore = modalNavigationStore;
|
||||||
_navigationService = navigationService;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Execute(object parameter)
|
public override void Execute(object parameter)
|
||||||
{
|
{
|
||||||
AddTournamentViewModel addTournamentViewModel = new AddTournamentViewModel(_tournamentStore, _modalNavigationStore, _navigationService);
|
AddTournamentViewModel addTournamentViewModel = new AddTournamentViewModel(_tournamentStore, _modalNavigationStore);
|
||||||
_modalNavigationStore.CurrentViewModel = addTournamentViewModel;
|
_modalNavigationStore.CurrentViewModel = addTournamentViewModel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,9 @@
|
|||||||
<DataTemplate DataType="{x:Type vms:OverviewViewModel}">
|
<DataTemplate DataType="{x:Type vms:OverviewViewModel}">
|
||||||
<views:OverviewView/>
|
<views:OverviewView/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
<DataTemplate DataType="{x:Type vms:LayoutViewModel}">
|
||||||
|
<components:Layout/>
|
||||||
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type vms:GroupsViewModel}">
|
<DataTemplate DataType="{x:Type vms:GroupsViewModel}">
|
||||||
<views:GroupsView/>
|
<views:GroupsView/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|||||||
9
Apollon.WPF/Services/INavigationService.cs
Normal file
9
Apollon.WPF/Services/INavigationService.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
using Apollon.WPF.ViewModels;
|
||||||
|
|
||||||
|
namespace Apollon.WPF.Services
|
||||||
|
{
|
||||||
|
public interface INavigationService<TViewModel> where TViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
void Navigate();
|
||||||
|
}
|
||||||
|
}
|
||||||
29
Apollon.WPF/Services/LayoutNavigationService.cs
Normal file
29
Apollon.WPF/Services/LayoutNavigationService.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using Apollon.WPF.Stores;
|
||||||
|
using Apollon.WPF.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Apollon.WPF.Services
|
||||||
|
{
|
||||||
|
public class LayoutNavigationService<TViewModel> : INavigationService<TViewModel> where TViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private readonly NavigationStore _navigationStore;
|
||||||
|
private readonly Func<TViewModel> _createViewModel;
|
||||||
|
private readonly Func<NavBarPreparationViewModel> _createNavBarPreparationViewModel;
|
||||||
|
|
||||||
|
public LayoutNavigationService(NavigationStore navigationStore, Func<TViewModel> createViewModel, Func<NavBarPreparationViewModel> createNavBarPreparationViewModel)
|
||||||
|
{
|
||||||
|
_navigationStore = navigationStore;
|
||||||
|
_createViewModel = createViewModel;
|
||||||
|
_createNavBarPreparationViewModel = createNavBarPreparationViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Navigate()
|
||||||
|
{
|
||||||
|
_navigationStore.CurrentViewModel = new LayoutViewModel(_createNavBarPreparationViewModel(), _createViewModel());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,8 +8,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace Apollon.WPF.Services
|
namespace Apollon.WPF.Services
|
||||||
{
|
{
|
||||||
public class NavigationService<TViewModel>
|
public class NavigationService<TViewModel> : INavigationService<TViewModel> where TViewModel : ViewModelBase
|
||||||
where TViewModel : ViewModelBase
|
|
||||||
{
|
{
|
||||||
private readonly NavigationStore _navigationStore;
|
private readonly NavigationStore _navigationStore;
|
||||||
private readonly Func<TViewModel> _createViewModel;
|
private readonly Func<TViewModel> _createViewModel;
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ namespace Apollon.WPF.ViewModels
|
|||||||
{
|
{
|
||||||
public AddEditDetailsViewModel AddEditDetailsViewModel { get; }
|
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);
|
ICommand cancelCommand = new CloseModalCommand(modalNavigationStore);
|
||||||
AddEditDetailsViewModel = new AddEditDetailsViewModel(submitCommand, cancelCommand);
|
AddEditDetailsViewModel = new AddEditDetailsViewModel(submitCommand, cancelCommand);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,6 @@ namespace Apollon.WPF.ViewModels
|
|||||||
{
|
{
|
||||||
public class ArchersViewModel : ViewModelBase
|
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 class ClassesViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
public TournamentDetailsViewModel TournamentDetailsViewModel { get; }
|
|
||||||
public NavBarPreparationViewModel NavBarPreparationViewModel { get; }
|
|
||||||
|
|
||||||
public ClassesViewModel(NavBarPreparationViewModel navBarPreparationViewModel, SelectedTournamentsStore selectedTournamentsStore)
|
|
||||||
{
|
|
||||||
TournamentDetailsViewModel = new TournamentDetailsViewModel(selectedTournamentsStore);
|
|
||||||
NavBarPreparationViewModel = navBarPreparationViewModel;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,18 +13,11 @@ namespace Apollon.WPF.ViewModels
|
|||||||
{
|
{
|
||||||
public class GroupsViewModel : ViewModelBase
|
public class GroupsViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public TournamentDetailsViewModel TournamentDetailsViewModel { get; }
|
|
||||||
public NavBarPreparationViewModel NavBarPreparationViewModel { get; }
|
|
||||||
public ICommand NavigateOverviewCommand { get; }
|
public ICommand NavigateOverviewCommand { get; }
|
||||||
|
|
||||||
public GroupsViewModel(NavBarPreparationViewModel navBarPreparationViewModel, SelectedTournamentsStore selectedTournamentStore, NavigationService<OverviewViewModel> overviewNavigationService)
|
public GroupsViewModel(INavigationService<OverviewViewModel> overviewNavigationService)
|
||||||
{
|
{
|
||||||
TournamentDetailsViewModel = new TournamentDetailsViewModel(selectedTournamentStore);
|
//NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
|
||||||
|
|
||||||
NavBarPreparationViewModel = navBarPreparationViewModel;
|
|
||||||
|
|
||||||
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 NavigateNamelistCommand { get;}
|
||||||
public ICommand NavigateArchersCommand { get;}
|
public ICommand NavigateArchersCommand { get;}
|
||||||
|
|
||||||
public NavBarPreparationViewModel(NavigationService<OverviewViewModel> overviewNavigationService,
|
public NavBarPreparationViewModel(INavigationService<OverviewViewModel> overviewNavigationService,
|
||||||
NavigationService<GroupsViewModel> groupNavigationService,
|
INavigationService<GroupsViewModel> groupNavigationService,
|
||||||
NavigationService<NameListViewModel> namelistNavigationService,
|
INavigationService<NameListViewModel> namelistNavigationService,
|
||||||
NavigationService<ClassesViewModel> classNavigationService,
|
INavigationService<ClassesViewModel> classNavigationService,
|
||||||
NavigationService<ArchersViewModel> archersNavigationService)
|
INavigationService<ArchersViewModel> archersNavigationService)
|
||||||
{
|
{
|
||||||
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
|
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
|
||||||
NavigateGroupsCommand = new NavigateCommand<GroupsViewModel>(groupNavigationService);
|
NavigateGroupsCommand = new NavigateCommand<GroupsViewModel>(groupNavigationService);
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ namespace Apollon.WPF.ViewModels
|
|||||||
public int Targets => SelectedTournament?.Targets ?? 0;
|
public int Targets => SelectedTournament?.Targets ?? 0;
|
||||||
|
|
||||||
public ICommand NavigatePreparationCommand { get; }
|
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 = selectedTournamentStore;
|
||||||
|
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ namespace Apollon.WPF.ViewModels
|
|||||||
public ICommand NavigateNameListCommand { get; }
|
public ICommand NavigateNameListCommand { get; }
|
||||||
|
|
||||||
public OverviewViewModel(TournamentsStore tournamentStore, SelectedTournamentsStore selectedTournamentStore,
|
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);
|
OverviewListingViewModel = new OverviewListingViewModel(selectedTournamentStore, modalNavigationStore, tournamentStore);
|
||||||
OverviewDetailsViewModel = new OverviewDetailsViewModel(selectedTournamentStore ,groupNavigationService);
|
OverviewDetailsViewModel = new OverviewDetailsViewModel(selectedTournamentStore, groupNavigationService);
|
||||||
|
|
||||||
LoadTournamentsCommand = new LoadTournamentsCommand(this, tournamentStore);
|
LoadTournamentsCommand = new LoadTournamentsCommand(this, tournamentStore);
|
||||||
OpenAddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, groupNavigationService);
|
OpenAddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore);
|
||||||
NavigateNameListCommand = new NavigateCommand<NameListViewModel>(NameListNavigationService);
|
NavigateNameListCommand = new NavigateCommand<NameListViewModel>(NameListNavigationService);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -60,10 +60,10 @@ namespace Apollon.WPF.ViewModels
|
|||||||
public static OverviewViewModel LoadViewModel(SelectedTournamentsStore selectedTournamentStore,
|
public static OverviewViewModel LoadViewModel(SelectedTournamentsStore selectedTournamentStore,
|
||||||
ModalNavigationStore modalNavigationStore,
|
ModalNavigationStore modalNavigationStore,
|
||||||
TournamentsStore tournamentStore,
|
TournamentsStore tournamentStore,
|
||||||
NavigationService<GroupsViewModel> groupNavigationService,
|
INavigationService<NameListViewModel> NameListNavigationService,
|
||||||
NavigationService<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);
|
viewModel.LoadTournamentsCommand.Execute(null);
|
||||||
|
|
||||||
|
|||||||
@@ -6,22 +6,7 @@
|
|||||||
xmlns:local="clr-namespace:Apollon.WPF.Views" xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
|
xmlns:local="clr-namespace:Apollon.WPF.Views" xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="680" d:DesignWidth="1100">
|
d:DesignHeight="680" d:DesignWidth="1100">
|
||||||
<Grid Margin="15, 35">
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="80"/>
|
|
||||||
<RowDefinition Height="550"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="250"/>
|
|
||||||
<ColumnDefinition />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Border BorderThickness="2" BorderBrush="{StaticResource BrushPrimary1}"
|
|
||||||
Grid.Row="1" Grid.Column="1"
|
|
||||||
CornerRadius="5">
|
|
||||||
<TextBlock Text="Teilnehmer" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="Teilnehmer" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
</Border>
|
|
||||||
|
|
||||||
<components:TournamentDetails Grid.Column="1" HorizontalAlignment="Center" DataContext="{Binding TournamentDetailsViewModel}"/>
|
|
||||||
<components:NavBarPreparationView Grid.RowSpan="2" DataContext="{Binding NavBarPreparationViewModel}"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -7,23 +7,8 @@
|
|||||||
xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
|
xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="680" d:DesignWidth="1100">
|
d:DesignHeight="680" d:DesignWidth="1100">
|
||||||
<Grid Margin="15, 35">
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="80"/>
|
|
||||||
<RowDefinition Height="550"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="250"/>
|
|
||||||
<ColumnDefinition />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Border BorderThickness="2" BorderBrush="{StaticResource BrushPrimary1}"
|
|
||||||
Grid.Row="1" Grid.Column="1"
|
|
||||||
CornerRadius="5">
|
|
||||||
<TextBlock Text="Klassen" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
<TextBlock Text="Klassen" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
</Border>
|
|
||||||
|
|
||||||
<components:TournamentDetails Grid.Column="1" HorizontalAlignment="Center" DataContext="{Binding TournamentDetailsViewModel}"/>
|
|
||||||
<components:NavBarPreparationView Grid.RowSpan="2" DataContext="{Binding NavBarPreparationViewModel}"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
34
Apollon.WPF/Views/Components/Layout.xaml
Normal file
34
Apollon.WPF/Views/Components/Layout.xaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<UserControl x:Class="Apollon.WPF.Views.Components.Layout"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:Apollon.WPF.Views.Components"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="680" d:DesignWidth="1100">
|
||||||
|
<Grid>
|
||||||
|
<Grid Margin="0 35 15 15">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="auto"/>
|
||||||
|
<RowDefinition Height="0"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="250"/>
|
||||||
|
<ColumnDefinition Width="*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<!--<Border BorderThickness="2"
|
||||||
|
BorderBrush="{StaticResource BrushPrimary1}"
|
||||||
|
Grid.Row="1" Grid.Column="1"
|
||||||
|
CornerRadius="5">
|
||||||
|
</Border>-->
|
||||||
|
|
||||||
|
<ContentControl Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Content="{Binding ContentVieModel}"/>
|
||||||
|
|
||||||
|
<local:TournamentDetails Height="80" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Center" DataContext="{Binding TournamentDetailsViewModel}"/>
|
||||||
|
<local:NavBarPreparationView Grid.RowSpan="2" DataContext="{Binding NavBarPreparationViewModel}"/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
28
Apollon.WPF/Views/Components/Layout.xaml.cs
Normal file
28
Apollon.WPF/Views/Components/Layout.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace Apollon.WPF.Views.Components
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for Layout.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class Layout : UserControl
|
||||||
|
{
|
||||||
|
public Layout()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="clr-namespace:Apollon.WPF.Views.Components"
|
xmlns:local="clr-namespace:Apollon.WPF.Views.Components"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="680" d:DesignWidth="1100">
|
d:DesignHeight="80" d:DesignWidth="1100">
|
||||||
<Grid Height="80">
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="auto"/>
|
||||||
<ColumnDefinition Width="600"/>
|
<ColumnDefinition Width="600"/>
|
||||||
|
|||||||
@@ -5,23 +5,8 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
|
xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="680" d:DesignWidth="1100">
|
d:DesignHeight="6800" d:DesignWidth="200">
|
||||||
<Grid Margin="15,35">
|
<Grid Background="Red">
|
||||||
<Grid.RowDefinitions>
|
<TextBlock Text="Gruppen" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<RowDefinition Height="80"/>
|
|
||||||
<RowDefinition Height="550"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="250"/>
|
|
||||||
<ColumnDefinition Width="*" />
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Border BorderThickness="2" BorderBrush="{StaticResource BrushPrimary1}"
|
|
||||||
Grid.Row="1" Grid.Column="1"
|
|
||||||
CornerRadius="5">
|
|
||||||
<TextBlock Text="Groups" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<components:TournamentDetails Grid.Column="1" HorizontalAlignment="Center" DataContext="{Binding TournamentDetailsViewModel}"/>
|
|
||||||
<components:NavBarPreparationView Grid.RowSpan="2" DataContext="{Binding NavBarPreparationViewModel}"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
<Image Grid.Column="2"
|
<Image Grid.Column="2"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Source="D:\Projekte\Apollon\Apollon\Apollon.WPF\Images\Archery.png"
|
Source="\images\Archery.png"
|
||||||
Width="250"
|
Width="250"
|
||||||
Height="250">
|
Height="250">
|
||||||
</Image>
|
</Image>
|
||||||
|
|||||||
Reference in New Issue
Block a user