I have an attached behavior. I'm using it in a PRISM based application, and it is listening to events from the EventAggregator.
Unfortunately the OnDetaching() method does not trigger at all, so I don't know when to Unsubscribe from the PRISM events. This is a problem for me because the behaviors are not getting disposed as the PRISM events are keeping them alive.
Is there a way to find all the attached behaviors on a control, and perhaps iterate over them to dispose them?
If not, any other work arounds?
View Complete Post