public partial class FrmEditSiteParticulars : Form, INotifyPropertyChanged
{
public enum EntryTypes
{
Undefined,
Site,
Particular
}
private EntryTypes _EntryType;
private EntryTypes EntryType {
get{return _EntryType;}
set
{
if (value != _EntryType)
{
_EntryType = value;
OnPropertyChanged("EntryType");
}
}
}
public event PropertyChangedEventHandler EntryTypeChanged;
protected void OnPropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = EntryTypeChanged;
if (handler != null)
handler(this, new PropertyChangedEventArgs(propertyName));
}
.
.
.
public event PropertyChangedEventHandler PropertyChanged;
.
.
.
and I added
this.EntryTypeChanged += new
System.ComponentModel.PropertyChangedEventHandler(this.EntryType_Changed);
inside InitializeComponent method..
Now when I open the Designer

I clicked Ignore and Continue, it worked fine..
Now when I close and open the solution again, the eventHandler code I put in the InitializeComponent is missing..
What is the problem?
Look at this:
There’s the answer. Put your code in the constructor, below
InitializeComponent();.