using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ListSample.Model { internal class Student : INotifyPropertyChanged { private string _name; private int _age; private string _phone; public event PropertyChangedEventHandler PropertyChanged; public Student(string name, int age, string phone) { this.Name = name; this.Age = age; this.Phone = phone; } public Student() : this("Name", 20, "123-4567-8910") { } public string Name { get { return _name; } set { _name = value; OnPropertyChanged(nameof(Name)); } } public int Age { get { return _age; } set { _age = value; OnPropertyChanged(nameof(Age)); } } public string Phone { get { return _phone; } set { _phone = value; OnPropertyChanged(nameof(Phone)); } } private void OnPropertyChanged(string propertyName) { if (this.PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } }