I'd like to run a method on property changed. I'd like my code to compile to something like this:
public string Property
{
get { return _property; }
set
{
_property= value;
IWantToCallFromHere(); // I want to inject this call
NotifyPropertyChanged();
}
}
This is described in the Wiki in the page named On_PropertyName_Changed.
Essentially you add a method with the naming convention
private void OnYourPropertyNameChanged()
A complete example of what you would like to achieve is as follows:
which gets translated into