diff --git a/LaDOSE.Src/LaDOSE.DTO/GameDTO.cs b/LaDOSE.Src/LaDOSE.DTO/GameDTO.cs index f6d256f..3b63759 100644 --- a/LaDOSE.Src/LaDOSE.DTO/GameDTO.cs +++ b/LaDOSE.Src/LaDOSE.DTO/GameDTO.cs @@ -9,5 +9,6 @@ public string ImgUrl { get; set; } public string WordPressTag { get; set; } public string WordPressTagOs { get; set; } + public int? SmashId { get; set; } } } \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/ShellViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/ShellViewModel.cs index a57dd2b..3c28361 100644 --- a/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/ShellViewModel.cs +++ b/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/ShellViewModel.cs @@ -10,7 +10,7 @@ using LaDOSE.REST.Event; namespace LaDOSE.DesktopApp.ViewModels { - public class ShellViewModel : Conductor.Collection.AllActive + public class ShellViewModel : Conductor.Collection.OneActive { private string _user; @@ -62,6 +62,7 @@ namespace LaDOSE.DesktopApp.ViewModels public void LoadGames() { ActivateItem(new GameViewModel(IoC.Get())); + } public void TournamentResult() diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/TournamentResultViewModel.cs b/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/TournamentResultViewModel.cs index 3df1ac3..0c0a08e 100644 --- a/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/TournamentResultViewModel.cs +++ b/LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/TournamentResultViewModel.cs @@ -168,9 +168,13 @@ namespace LaDOSE.DesktopApp.ViewModels { _selectedGame = value; //TODO: QUICK AND DIRTY - List resultForGame = this.Results.Results.Where(e => e.GameId == SelectedGame.Id).ToList(); - First = resultForGame.OrderByDescending(e => e.Point).First().Player; - SelectedGameResult = new ObservableCollection(resultForGame); + List 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(resultForGame); + } + NotifyOfPropertyChange(() => SelectedGame); } } diff --git a/LaDOSE.Src/LaDOSE.DesktopApp/Views/GameView.xaml b/LaDOSE.Src/LaDOSE.DesktopApp/Views/GameView.xaml index 729bfb8..1c031ab 100644 --- a/LaDOSE.Src/LaDOSE.DesktopApp/Views/GameView.xaml +++ b/LaDOSE.Src/LaDOSE.DesktopApp/Views/GameView.xaml @@ -42,10 +42,10 @@ - + @@ -71,6 +71,15 @@ + + + + + + + + +