using System.ComponentModel; namespace Tetris.Models; public class Party : INotifyPropertyChanged { private int _score; private string _userName; public Party(string userName) { _userName = userName; } public string UserName { get => _userName; set { _userName = value; OnPropertyChanged("UserName"); } } public int Score { get => _score; set { _score = value; OnPropertyChanged("Score"); } } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } }