In most tuts they say to write method like this:
private void OnPropertyChanged(string prop)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(prop));
}
}
and call it such as OnPropertyChanged("PropName");
. But this seems to be very static and unable to refactor automatically. Is there a way to do this more dynamically? I considered using System.Diagnostic.StackTrace
class to get the name of property, but it looks ugly and not much efficiently, and moreover I can't access it in for instance Windows Phone 8 app (why!?).