You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.5 KiB
66 lines
1.5 KiB
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));
|
|
}
|
|
}
|
|
}
|
|
|