Keeping eventhandlers during deserialisation

May 16, 2012 at 11:51 AM

I have an observablecollection and have some logic hooked up to CollectionChanged event. When I deserialise I lose this. Is there any way I can have it restored on deserialise? I have tried ObjectCreationHandling.Reuse but it doesn't seem to work.




May 16, 2012 at 12:24 PM

"Restored" is probably not the best word. I need it to reuse existing collections rather than recreate. That way I can keep the behaviour.