I am creating a custom control and i want to add some properties in it.
On few of the properties i want to create some events.
Say
if i have a property
public int Date {get; set;}
now if its value is changing i want to trigger a change event. SO how can i add event on this
Use a “normal” property rather than an automatic property, and raise the change event in the setter:
To raise the change event, if this is a standard INotifyPropertyChanged.PropertyChanged event:
It’s recommended practice to isolate this into an OnPropertyChanged method.
If you’re raising a custom DateChanged event, the logic will be similar but with different names and event args.