jaka jest różnica między raisepropertychanged a PropertyChanged?
Myślę, że oba są takie same, ale znalazłem ich użycie tylko w jednym pliku, takim jak poniższy kod code.here dla raisepropertychanged.
public decimal Amount
{
get
{
return _amount;
}
set
{
_amount = value;
RaisePropertyChanged("Amount");
}
}
tutaj kod dla właściwości 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 wyjaśnij różnicę między nimi: