Hi Daniel Schilling,
the event is not firing because you have not subscribed on the right place. If you let your class implement the
IInstanceCallbacks interface than you will have access to the lifecycle events of the persistent objects. This interface contains 3 methods that need to be implemented:
PostLoad() - fires when the first persistent field of a class is accessed. You can subscribe your collection to the event handler here
PreRemove(Iobjectscope scope) - this emthod is fired when an object is being removed from the scope
PreStore() - this method is fired when an object is being saved to the database.
To give you an example. If we have 2 classes, Details and Invoices and we let the Invoice implement the IInstanceCallbacks than we will have something similar to that:
I believe that you will find
this article useful.
Greetings,
PetarP
the Telerik team