Open/Close AddTournamentModal

This commit is contained in:
Natlinux81
2022-08-14 03:55:20 +02:00
parent ab742103de
commit 61f06a6b5d
12 changed files with 116 additions and 13 deletions

View File

@@ -95,8 +95,15 @@ namespace Apollon.WPF.ViewModels
}
public bool CanSubmit => !string.IsNullOrEmpty(Tournamentname);
public ICommand SubmitCommand { get; }
public ICommand CancelCommand { get; }
public AddEditDetailsViewModel(ICommand submitCommand, ICommand cancelCommand)
{
SubmitCommand = submitCommand;
CancelCommand = cancelCommand;
}
}

View File

@@ -1,8 +1,11 @@
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
{
@@ -10,9 +13,10 @@ namespace Apollon.WPF.ViewModels
{
public AddEditDetailsViewModel AddEditDetailsViewModel { get; }
public AddTournametViewModel()
public AddTournametViewModel(ModalNavigationStore modalNavigationStore)
{
AddEditDetailsViewModel = new AddEditDetailsViewModel();
ICommand cancelCommand = new CloseModalCommand(modalNavigationStore);
AddEditDetailsViewModel = new AddEditDetailsViewModel(null, cancelCommand);
}
}

View File

@@ -1,17 +1,22 @@
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 EditTournamentViewModel : ViewModelBase
{
public AddEditDetailsViewModel AddEditDetailsViewModel { get; }
public EditTournamentViewModel()
public EditTournamentViewModel(ModalNavigationStore modalNavigationStore)
{
AddEditDetailsViewModel = new AddEditDetailsViewModel();
ICommand cancelCommand = new CloseModalCommand(modalNavigationStore);
AddEditDetailsViewModel = new AddEditDetailsViewModel(null, cancelCommand); ;
}
}
}

View File

@@ -1,4 +1,5 @@
using Apollon.WPF.Stores;
using Apollon.WPF.Commands;
using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -12,12 +13,15 @@ namespace Apollon.WPF.ViewModels
{
public OverviewListingViewModel OverviewListingViewModel { get; }
public OverviewDetailsViewModel OverviewDetailsViewModel{ get; }
public ICommand AddTournamentCommand { get; }
public OverviewViewModel(SelectedTournamentStore _selectedTournamentStore)
public OverviewViewModel(SelectedTournamentStore _selectedTournamentStore, ModalNavigationStore modalNavigationStore)
{
OverviewListingViewModel = new OverviewListingViewModel(_selectedTournamentStore);
OverviewDetailsViewModel = new OverviewDetailsViewModel(_selectedTournamentStore);
AddTournamentCommand = new OpenAddTournamentCommand(modalNavigationStore);
}
}
}