HOW RAISE AN EVENT WHENEVER A PROPERTY'S VALUE CHANGED?
159804-Jan-2016
I want to use an event whenever a property's value changed . how to use this in a program please help me.
Home / DeveloperSection / Forums / HOW RAISE AN EVENT WHENEVER A PROPERTY'S VALUE CHANGED?
Anupam Mishra
06-Jan-2016Manoj Bhatt
05-Jan-2016Anupam Mishra
04-Jan-2016In C#, the INotifyPropertyChanged interface is used notify clients, typically binding clients, that a property value has changed.
For example, consider an Employee class object with a property called FirstName. To provide property-change notification, the Employee class type implements the INotifyPropertyChanged interface and raises a PropertyChanged event when FirstName is changed.
For change notification to occur in a binding between a bound client and a data source, your bound type should either:
· Implement the INotifyPropertyChanged interface (preferred).
· Provide a change event for each property of the bound type.
Do not do both.
For example, in below we have defined a property ‘FirstName’
Now, we have implementing the INotifyPropertyChanged interface
Output:
I think in above example you are understand about raises event when 'FirstName' property values are changed.
For more details , you click here