I have a storage class that has events on adding items to it. My form class handles the event. When I try to serialize it, formatter complains about form class not marked as serializable. Of course, I don't want to serialize it, however, i can't mark event as [NonSerialize] since it is not field...
What to do?
EDIT: Aditional info:
I tried both anonymous code block:
Storage.Instance.AllPartners.OnAdded +=
new Partners.Added(delegate(Partner p) {
viewPartners.RefreshData();
});
And event handler as member:
Storage.Instance.AllPartners.OnAdded += new Partners.Added(AllPartners_OnAdded);
void AllPartners_OnAdded(Partner partner)
{
viewPartners.RefreshData();
}