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.

56 lines
1.2 KiB

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BindingSample.Model
{
internal class Customer : INotifyPropertyChanged
{
private string _name;
private string _tel;
public event PropertyChangedEventHandler? PropertyChanged;
public Customer() : this("Name", "Tel")
{
}
public Customer(string name, string tel)
{
_name = name;
_tel = tel;
}
public string Name
{
get { return _name; }
set
{
_name = value;
OnPropertyChanged(nameof(Name));
}
}
public string Tel
{
get { return _tel; }
set
{
_tel = value;
OnPropertyChanged(nameof(Tel));
}
}
private void OnPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}