I am trying to implement Inotifypropertychange interface, such as
public class EmployeeDetails:INotifyPropertyChanged
{
private int employeeID;
public int EmployeeID
{
get { return employeeID; }
set { employeeID = value; this.NotifyPropertyChanged("EmployeeId"); }
}
private string employeeName;
public string EmployeeName
{
get { return employeeName; }
set { employeeName = value; this.NotifyPropertyChanged("EmployeeName"); }
}
private decimal salary;
public decimal Salary
{
get { return salary; }
set { salary = value; this.NotifyPropertyChanged("Salary"); }
}
public event PropertyChangedEventHandler propertychange;
public void NotifyPropertyChanged(string name)
{
if (propertychange != null)
propertychange(this, new PropertyChangedEventArgs(name));
}
public EmployeeDetails(int employeeId, string employeeName, decimal salary)
{
EmployeeID = employeeID;
EmployeeName = employeeName;
Salary = salary;
}
public EmployeeDetails()
{
// TODO: Complete member initialization
}
}
while debuging, it shows the following error:
‘EmployeeDetails’ does not implement interface member ‘System.ComponentModel.INotifyPropertyChange
what particular code i missing, please help
i have included the system.component assembly.
You can use this code
And you right click on INotifyPropertyChanged, firstly you execute resolve reference and select implement interface