try NavBar

This commit is contained in:
Natlinux
2022-11-27 15:18:07 +01:00
parent a2c926f915
commit d45c0cc1d5
17 changed files with 69 additions and 122 deletions

View File

@@ -135,7 +135,7 @@ namespace Apollon.WPF.ViewModels
}
private int _rounds;
public int Rounds
public int Groups
{
get
{
@@ -144,7 +144,7 @@ namespace Apollon.WPF.ViewModels
set
{
_rounds = value;
OnPropertyChanged(nameof(Rounds));
OnPropertyChanged(nameof(Groups));
}
}

View File

@@ -32,7 +32,7 @@ namespace Apollon.WPF.ViewModels
StartDate = tournament.StartDate,
EndDate = tournament.EndDate,
Location = tournament.Location,
Rounds = tournament.Rounds,
Groups = tournament.Rounds,
Targets = tournament.Targets,
};

View File

@@ -1,12 +1,24 @@
using System;
using Apollon.WPF.Commands;
using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Apollon.WPF.ViewModels
{
public class GroupsViewModel : ViewModelBase
{
public TournamentDetailsViewModel TournamentDetailsViewModel { 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));
}
}
}

View File

@@ -8,7 +8,7 @@ using System.Windows.Input;
namespace Apollon.WPF.ViewModels
{
public class NavBarTournamentDetailsViewModel : ViewModelBase
public class NavBarPreparationViewModel : ViewModelBase
{
public ICommand NavigateArchersCommand { get;}
public ICommand NavigateGroupsCommand { get;}

View File

@@ -27,7 +27,7 @@ namespace Apollon.WPF.ViewModels
public int Rounds => SelectedTournament?.Rounds ?? 0;
public int Targets => SelectedTournament?.Targets ?? 0;
public ICommand NavigateTournamentDetailsCommand { get; }
public ICommand NavigatePreparationCommand { get; }
public OverviewDetailsViewModel(SelectedTournamentsStore selectedTournamentStore, NavigationStore navigationStore, ModalNavigationStore modalNavigationStore,TournamentsStore tournamentsStore)
{
@@ -35,7 +35,7 @@ namespace Apollon.WPF.ViewModels
_selectedTournamentStore.SelectedTournamentChanged += SelectedTournamentStore_SelectedTournamentChanged;
NavigateTournamentDetailsCommand = new NavigateCommand<PreparationViewModel>(navigationStore, () => new PreparationViewModel(_selectedTournamentStore,navigationStore, modalNavigationStore, tournamentsStore));
NavigatePreparationCommand = new NavigateCommand<GroupsViewModel>(navigationStore, () => new GroupsViewModel(selectedTournamentStore, navigationStore, modalNavigationStore, tournamentsStore));
}
protected override void Dispose()

View File

@@ -46,7 +46,7 @@ namespace Apollon.WPF.ViewModels
public bool HasErrorMessage => !string.IsNullOrEmpty(ErrorMessage);
public ICommand AddTournamentCommand { get; }
public ICommand OpenAddTournamentCommand { get; }
public ICommand LoadTournamentsCommand { get; }
public ICommand NavigateNameListCommand { get; }
@@ -57,7 +57,7 @@ namespace Apollon.WPF.ViewModels
OverviewDetailsViewModel = new OverviewDetailsViewModel(selectedTournamentStore ,navigationStore, modalNavigationStore,tournamentStore);
LoadTournamentsCommand = new LoadTournamentsCommand(this, tournamentStore);
AddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, navigationStore, selectedTournamentStore);
OpenAddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, navigationStore, selectedTournamentStore);
NavigateNameListCommand = new NavigateCommand<NameListViewModel>(navigationStore, () => new NameListViewModel());
}

View File

@@ -1,28 +0,0 @@
using Apollon.Domain.Models;
using Apollon.WPF.Commands;
using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Apollon.WPF.ViewModels
{
public class PreparationViewModel : ViewModelBase
{
public TournamentDetailsViewModel TournamentDetailsViewModel { get; }
public ICommand NavigateOverviewCommand { get; }
public PreparationViewModel(SelectedTournamentsStore selectedTournamentStore, NavigationStore navigationStore, ModalNavigationStore modalNavigationStore, TournamentsStore tournamentsStore)
{
TournamentDetailsViewModel = new TournamentDetailsViewModel(selectedTournamentStore);
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(navigationStore, () => OverviewViewModel.LoadViewModel(selectedTournamentStore, modalNavigationStore, tournamentsStore, navigationStore));
}
}
}