Sometimes you might want to let the designer serializer serialize the changes in base fields via a property rather than the field itself using the AccessedThroughProperty attribute in the System.Runtime.CompilerServices namespace.
public class CustomForm : Form
{
[ AccessedThroughProperty( "CustomList" ) ]
private ArrayList customList;
public ArrayList CustomList
{
get { return customList; }
}
}
Then when the above form is inherited and items get added to the inherited form's designer, code will be added as follows in the inherited form's InitializeComponent:
private void InitializeComponent()
{
// ...
this.CustomList.Add( aNewItem );
}
Contributed from George Shepherd's Windows Forms FAQ