Then in the Dispose of your BaseBO, you know what you need to do. The other option would be to use reflection which gets more complicated, but you wouldn't ahve to do anything within the inherited BOs. The downside of reflections, though, could be that it could slow things down if not done 100% right.
I have added the below code to my base BO....
DeclaredBOs.Clear() End If MyBase.Dispose(disposing)
End Sub
...however, i'm still not seeing the BO getting disposed of properly. I feel like I have to be missing something. I have a form with a grid and a textbox on it, both of which are bound to a BO. The grid is bound through a BBS. When I close the form, it appears to be hitting all of the appropriate logic to dispose of the BO, but when I look at it in a memory profiler, it shows 5 instances of the BO in memory. What it seems like it 1 instance for the textbox, and 4 instances for the grid (one for each row of data). If I only have one row of data in the grid, there is only one instance of the BO.
SO a couple of questions... why are there so many instances of the BO in memory? It seems as if it is creating an instance for each control it's binding to, and I would expect one instance only. Also, is there anything else I could possibly be overlooking in this scenario that would be causing the BO to stay in memory. I have been looking at this for over a week now and am still not able to pinpoint the cause of why my BOs are staying in memory and not disposing correctly.