Correction bug SmashGG Id / Changement Fenetre

This commit is contained in:
2022-07-30 14:41:57 +02:00
parent 688bb257a5
commit d4ff238494
4 changed files with 20 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ using LaDOSE.REST.Event;
namespace LaDOSE.DesktopApp.ViewModels
{
public class ShellViewModel : Conductor<IScreen>.Collection.AllActive
public class ShellViewModel : Conductor<IScreen>.Collection.OneActive
{
private string _user;
@@ -62,6 +62,7 @@ namespace LaDOSE.DesktopApp.ViewModels
public void LoadGames()
{
ActivateItem(new GameViewModel(IoC.Get<RestService>()));
}
public void TournamentResult()

View File

@@ -168,9 +168,13 @@ namespace LaDOSE.DesktopApp.ViewModels
{
_selectedGame = value;
//TODO: QUICK AND DIRTY
List<ResultDTO> resultForGame = this.Results.Results.Where(e => e.GameId == SelectedGame.Id).ToList();
First = resultForGame.OrderByDescending(e => e.Point).First().Player;
SelectedGameResult = new ObservableCollection<ResultDTO>(resultForGame);
List<ResultDTO> resultForGame = this.Results.Results.Where(e => e.GameId == SelectedGame?.Id).ToList();
if (resultForGame.Any())
{
First = resultForGame.OrderByDescending(e => e.Point).First().Player;
SelectedGameResult = new ObservableCollection<ResultDTO>(resultForGame);
}
NotifyOfPropertyChange(() => SelectedGame);
}
}