I am following the PluralSight tutorials on WPF and data binding. My code giving an error when trying to implement INotifyPropertyChanged
.
public class Employee : INotifyPropertyChanged
{
public string Name { get; set; }
public string Title { get; set; }
public static Employee getEmployee()
{
var emp = new Employee() { Name = "Tom", Title = "Developer" };
return emp;
}
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged( [CallerMemberName] string caller = "")
{
if ( PropertyChanged != null)
{
PropertyChanged (this,
new PropertyChangingEventArgs (caller));
}
}
}
The error is on the last statement (at the end of the if statement), saying:
"Cannot convert from System.ComponentModel.PropertyChangingEventArgs to System.ComponentModel.PropertyChangedEventArgs"