finish addedit

This commit is contained in:
Natlinux81
2022-09-09 23:50:17 +02:00
parent e2f41a8f43
commit b3c62b0104
12 changed files with 81 additions and 34 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
namespace Apollon.WPF.ViewModels
@@ -56,13 +57,13 @@ namespace Apollon.WPF.ViewModels
public string CompetitionImage
{
get
{
{
return _competitionImage;
}
set
{
_competitionImage = value;
OnPropertyChanged(nameof(CompetitionImage));
OnPropertyChanged(nameof(CompetitionImage));;
}
}

View File

@@ -13,9 +13,9 @@ namespace Apollon.WPF.ViewModels
{
public AddEditDetailsViewModel AddEditDetailsViewModel { get; }
public AddTournamentViewModel(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore, NavigationStore navigationStore)
public AddTournamentViewModel(TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore, NavigationStore navigationStore,SelectedTournamentsStore selectedTournamentsStore)
{
ICommand submitCommand = new AddTournamentCommand(this, tournamentStore,modalNavigationStore,navigationStore);
ICommand submitCommand = new AddTournamentCommand(this, tournamentStore,modalNavigationStore,navigationStore, selectedTournamentsStore);
ICommand cancelCommand = new CloseModalCommand(modalNavigationStore);
AddEditDetailsViewModel = new AddEditDetailsViewModel(submitCommand, cancelCommand);
}

View File

@@ -26,7 +26,8 @@ namespace Apollon.WPF.ViewModels
{
Organisation = tournament.Organisation,
TournamentName = tournament.TournamentName,
Competition = tournament.Competition,
Competition = tournament.Competition,
CompetitionImage = tournament.CompetitionImage,
StartDate = tournament.StartDate,
EndDate = tournament.EndDate,
Location = tournament.Location,

View File

@@ -1,16 +1,23 @@
using Apollon.WPF.Stores;
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 NavBarViewModel : ViewModelBase
{
public NavBarViewModel(NavigationStore navigationStore)
public ICommand NavigateOverviewCommand { get; }
public NavBarViewModel(NavigationStore navigationStore, SelectedTournamentsStore selectedTournamentsStore, ModalNavigationStore modalNavigationStore, TournamentsStore tournamentsStore)
{
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(navigationStore, () => new OverviewViewModel(tournamentsStore, selectedTournamentsStore, modalNavigationStore,navigationStore));
}
}
}

View File

@@ -17,7 +17,7 @@ namespace Apollon.WPF.ViewModels
public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation";
public string TournamentName => SelectedTournament?.TournamentName ?? "kein Name";
public string Competition => SelectedTournament?.Competition ?? "keine Kategorie";
public string CompetitionImage => SelectedTournament?.CompetitionImage ?? "kein Bild";
public string CompetitionImage => SelectedTournament?.CompetitionImage ?? "D:\\Projekte\\Apollon\\Apollon\\Apollon.WPF\\Images\\Archery.png";
public string StartDate => SelectedTournament?.StartDate.ToString("d") ?? "kein Datum";
public string EndDate => SelectedTournament?.EndDate.ToString("d") ?? "kein Datum";
public string Location => SelectedTournament?.Location ?? "kein Ort";

View File

@@ -57,8 +57,8 @@ namespace Apollon.WPF.ViewModels
OverviewDetailsViewModel = new OverviewDetailsViewModel(selectedTournamentStore);
LoadTournamentsCommand = new LoadTournamentsCommand(this, tournamentStore);
AddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, navigationStore);
NavigateNavBarCommand = new NavigateCommand<NavBarViewModel>(navigationStore, () => new NavBarViewModel(navigationStore));
AddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, navigationStore, selectedTournamentStore);
NavigateNavBarCommand = new NavigateCommand<NavBarViewModel>(navigationStore, () => new NavBarViewModel(navigationStore,selectedTournamentStore,modalNavigationStore,tournamentStore));
}