Edit Function are available

This commit is contained in:
Natlinux81
2022-08-18 17:49:23 +02:00
parent 99c3bd58e1
commit 44e2e17c15
17 changed files with 203 additions and 100 deletions

View File

@@ -1,4 +1,6 @@
using Apollon.WPF.Models;
using Apollon.WPF.Commands;
using Apollon.WPF.Models;
using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -9,16 +11,28 @@ using System.Windows.Input;
namespace Apollon.WPF.ViewModels
{
public class OverviewListingItemViewModel : ViewModelBase
{
public Tournament Tournament { get;}
{
public Tournament Tournament { get; private set; }
public string TournamentName => Tournament.TournamentName;
public string Location => Tournament.Location;
public ICommand EditCommand { get; }
public ICommand DeleteCommand { get; }
public OverviewListingItemViewModel(Tournament tournament)
public OverviewListingItemViewModel(Tournament tournament, TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore)
{
Tournament = tournament;
EditCommand = new OpenEditTournamentCommand(this, tournamentStore, modalNavigationStore);
}
public void Update(Tournament tournament)
{
Tournament = tournament;
OnPropertyChanged(nameof(TournamentName));
OnPropertyChanged(nameof(Location));
}
}
}