preparationview
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Apollon.WPF.ViewModels
|
||||
|
||||
_selectedTournamentStore.SelectedTournamentChanged += SelectedTournamentStore_SelectedTournamentChanged;
|
||||
|
||||
NavigateTournamentDetailsCommand = new NavigateCommand<TournamentDetailsViewModel>(navigationStore, () => new TournamentDetailsViewModel(navigationStore, selectedTournamentStore, modalNavigationStore, tournamentsStore));
|
||||
NavigateTournamentDetailsCommand = new NavigateCommand<PreparationViewModel>(navigationStore, () => new PreparationViewModel(_selectedTournamentStore,navigationStore, modalNavigationStore, tournamentsStore));
|
||||
}
|
||||
|
||||
protected override void Dispose()
|
||||
|
||||
28
Apollon.WPF/ViewModels/PreparationViewModel.cs
Normal file
28
Apollon.WPF/ViewModels/PreparationViewModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,7 @@ using System.Windows.Input;
|
||||
namespace Apollon.WPF.ViewModels
|
||||
{
|
||||
public class TournamentDetailsViewModel : ViewModelBase
|
||||
|
||||
{
|
||||
|
||||
private readonly SelectedTournamentsStore _selectedTournamentsStore;
|
||||
private Tournament SelectedTournament => _selectedTournamentsStore.SelectedTournament;
|
||||
|
||||
@@ -28,12 +26,10 @@ namespace Apollon.WPF.ViewModels
|
||||
public string Location => SelectedTournament?.Location ?? "kein Ort";
|
||||
public int Rounds => SelectedTournament?.Rounds ?? 0;
|
||||
public int Targets => SelectedTournament?.Targets ?? 0;
|
||||
|
||||
public ICommand NavigateOverviewCommand { get; }
|
||||
public TournamentDetailsViewModel(NavigationStore navigationStore, SelectedTournamentsStore selectedTournamentsStore, ModalNavigationStore modalNavigationStore, TournamentsStore tournamentsStore)
|
||||
{
|
||||
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(navigationStore, () => OverviewViewModel.LoadViewModel( selectedTournamentsStore, modalNavigationStore, tournamentsStore, navigationStore));
|
||||
|
||||
|
||||
public TournamentDetailsViewModel(SelectedTournamentsStore selectedTournamentsStore)
|
||||
{
|
||||
_selectedTournamentsStore = selectedTournamentsStore;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user