before adding LoadingSpinner
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Apollon.WPF.Stores;
|
||||
using Apollon.WPF.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -9,15 +10,19 @@ namespace Apollon.WPF.Commands
|
||||
{
|
||||
public class LoadTournamentsCommand : AsyncCommandBase
|
||||
{
|
||||
private readonly OverviewViewModel _overviewViewModel;
|
||||
private readonly TournamentsStore _tournamentStore;
|
||||
|
||||
public LoadTournamentsCommand(TournamentsStore tournamentStore)
|
||||
public LoadTournamentsCommand(OverviewViewModel overviewViewModel, TournamentsStore tournamentStore)
|
||||
{
|
||||
_overviewViewModel = overviewViewModel;
|
||||
_tournamentStore = tournamentStore;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object parameter)
|
||||
{
|
||||
_overviewViewModel.IsLoading = true;
|
||||
|
||||
try
|
||||
{
|
||||
await _tournamentStore.Load();
|
||||
@@ -26,6 +31,10 @@ namespace Apollon.WPF.Commands
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
_overviewViewModel.IsLoading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user