[Version 2.0] Collection not changing when Document is closed

May 27, 2012 at 9:17 AM

Hi,

I'm using the MVVM pattern to associate the document tabs in AvalonDock with a collection of ViewModels which is an ObservableCollection<T>.

It almost works perfect, however when I close a document tab in the frontend the underlying collection is not changed.

May 27, 2012 at 8:06 PM

In current version AD doesn't remove the object from the source collection even if it implements IList, the best you can do now is to handle the DocumentClose event of the DockingManager and remove the document by yourself.
Final version will handle this automatically.

May 27, 2012 at 11:29 PM

Thank you. Using the DocumentClosed event worked just perfect. I'll use that until the final is out.