diff --git a/Qwirkle/QwirkleViews/Pages/GameBoard.xaml.cs b/Qwirkle/QwirkleViews/Pages/GameBoard.xaml.cs index 9e4cbd4..a67c81f 100644 --- a/Qwirkle/QwirkleViews/Pages/GameBoard.xaml.cs +++ b/Qwirkle/QwirkleViews/Pages/GameBoard.xaml.cs @@ -24,7 +24,7 @@ public partial class Gameboard : ContentPage, INotifyPropertyChanged set { playerCells1 = value; - OnPropertyChanged(nameof(PlayerCells1)); + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("PlayerCells1")); } } public Gameboard() @@ -62,6 +62,7 @@ public partial class Gameboard : ContentPage, INotifyPropertyChanged game.PlaceTile(game.GetPlayingPlayer(), tiledrag!, x, y); game.PlaceTileNotified -= Game_PlaceTileNotified; + PlayerCells1 = new ObservableCollection(game.PlayerList[0].Tiles.ToList()); } @@ -70,10 +71,5 @@ public partial class Gameboard : ContentPage, INotifyPropertyChanged DisplayAlert("Tile place notified", args.Reason, "<3"); } - public event PropertyChangedEventHandler PropertyChanged; - - protected virtual void OnPropertyChanged(string propertyName) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } + public event PropertyChangedEventHandler? PropertyChanged; } \ No newline at end of file diff --git a/Qwirkle/QwirkleViews/Pages/Gameboard.xaml b/Qwirkle/QwirkleViews/Pages/Gameboard.xaml index 7dafa8f..218a1b5 100644 --- a/Qwirkle/QwirkleViews/Pages/Gameboard.xaml +++ b/Qwirkle/QwirkleViews/Pages/Gameboard.xaml @@ -26,7 +26,7 @@ DropCommand="{Binding OnDrop, Source={x:Reference root}}" DropCommandParameter="{Binding .}" /> -