diff --git a/Qwirkle/QwirkleViews/Views/Scoreboard.xaml b/Qwirkle/QwirkleViews/Views/Scoreboard.xaml index 1bc0c8d..2128384 100644 --- a/Qwirkle/QwirkleViews/Views/Scoreboard.xaml +++ b/Qwirkle/QwirkleViews/Views/Scoreboard.xaml @@ -8,13 +8,14 @@ - + + - + diff --git a/Qwirkle/QwirkleViews/Views/Scoreboard.xaml.cs b/Qwirkle/QwirkleViews/Views/Scoreboard.xaml.cs index 82d3f81..56402d9 100644 --- a/Qwirkle/QwirkleViews/Views/Scoreboard.xaml.cs +++ b/Qwirkle/QwirkleViews/Views/Scoreboard.xaml.cs @@ -3,6 +3,7 @@ using QwirkleClassLibrary.Games; using QwirkleClassLibrary.Boards; using System.Collections.ObjectModel; using System.ComponentModel; +using System.Linq; namespace Qwirkle.Views; @@ -12,10 +13,10 @@ public partial class Scoreboard : ContentView, INotifyPropertyChanged private IOrderedEnumerable> scoreboard; - private ObservableCollection> scoreboardList; + private ObservableCollection>? scoreboardList; public ObservableCollection> ScoreboardList { - get => scoreboardList; + get => scoreboardList!; set { if (scoreboardList != value) @@ -34,13 +35,6 @@ public partial class Scoreboard : ContentView, INotifyPropertyChanged scoreboard = game.ScoreBoard.OrderByDescending(x => x.Value).ThenBy(x => x.Key); ScoreboardList = new ObservableCollection>(scoreboard); - game.Board.PropertyChanged += Board_PropertyChanged; - } - - private void Board_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e) - { - scoreboard = game.ScoreBoard.OrderByDescending(x => x.Value).ThenBy(x => x.Key.NameTag); - ScoreboardList = new ObservableCollection>(scoreboard); } public event PropertyChangedEventHandler? PropertyChanged; @@ -49,4 +43,4 @@ public partial class Scoreboard : ContentView, INotifyPropertyChanged { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } -} \ No newline at end of file +} diff --git a/Qwirkle/QwirkleViews/Views/ScoreboardLine.xaml b/Qwirkle/QwirkleViews/Views/ScoreboardLine.xaml index f67d9ec..7fde565 100644 --- a/Qwirkle/QwirkleViews/Views/ScoreboardLine.xaml +++ b/Qwirkle/QwirkleViews/Views/ScoreboardLine.xaml @@ -17,12 +17,11 @@ Style="{StaticResource RectangleTab}" Grid.Column="1"/> -