deleted still shows on the details panel
This commit is contained in:
@@ -14,10 +14,8 @@ namespace Apollon.WPF.Commands
|
||||
{
|
||||
await ExecuteAsync(parameter);
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
public abstract Task ExecuteAsync(object parameter);
|
||||
}
|
||||
}
|
||||
|
||||
37
Apollon.WPF/Commands/DeleteTournamentCommand.cs
Normal file
37
Apollon.WPF/Commands/DeleteTournamentCommand.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Apollon.Domain.Models;
|
||||
using Apollon.WPF.Stores;
|
||||
using Apollon.WPF.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Apollon.WPF.Commands
|
||||
{
|
||||
public class DeleteTournamentCommand : AsyncCommandBase
|
||||
{
|
||||
private readonly OverviewListingItemViewModel _overviewListingItemViewModel;
|
||||
private readonly TournamentsStore _tournamentStore;
|
||||
|
||||
public DeleteTournamentCommand(OverviewListingItemViewModel overviewListingItemViewModel, TournamentsStore tournamentStore)
|
||||
{
|
||||
_overviewListingItemViewModel = overviewListingItemViewModel;
|
||||
_tournamentStore = tournamentStore;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object parameter)
|
||||
{
|
||||
Tournament tournament = _overviewListingItemViewModel.Tournament;
|
||||
|
||||
try
|
||||
{
|
||||
await _tournamentStore.Delete(tournament.Id);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
31
Apollon.WPF/Commands/LoadTournamentsCommand.cs
Normal file
31
Apollon.WPF/Commands/LoadTournamentsCommand.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Apollon.WPF.Stores;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Apollon.WPF.Commands
|
||||
{
|
||||
public class LoadTournamentsCommand : AsyncCommandBase
|
||||
{
|
||||
private readonly TournamentsStore _tournamentStore;
|
||||
|
||||
public LoadTournamentsCommand(TournamentsStore tournamentStore)
|
||||
{
|
||||
_tournamentStore = tournamentStore;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object parameter)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _tournamentStore.Load();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,9 @@ namespace Apollon.WPF.Commands
|
||||
private readonly OverviewListingItemViewModel _overviewListingItemViewModel;
|
||||
private readonly TournamentsStore _tournamentStore;
|
||||
|
||||
public OpenEditTournamentCommand(OverviewListingItemViewModel overviewListingItemViewModel, TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore)
|
||||
public OpenEditTournamentCommand(OverviewListingItemViewModel overviewListingItemViewModel,
|
||||
TournamentsStore tournamentStore,
|
||||
ModalNavigationStore modalNavigationStore)
|
||||
{
|
||||
_overviewListingItemViewModel = overviewListingItemViewModel;
|
||||
_tournamentStore = tournamentStore;
|
||||
|
||||
Reference in New Issue
Block a user