i think both are same,but i found use of them in only one file such as below code.here code for raisepropertychanged .
public decimal Amount
{
get
{
return _amount;
}
set
{
_amount = value;
RaisePropertyChanged("Amount");
}
}
here code for PropertyChanged:
public event PropertyChangedEventHandler PropertyChanged;
private void RaisePropertyChanged(string propertyName)
{
// take a copy to prevent thread issues
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
plz explain difference between them:
PropertyChangedis an event.RaisePropertyChangedis the method used to raise the event.Of course, you could invoke the event directly from your property setter, but then you would have to check every time if the handler is not null… better to do it in one place.