This project has moved and is read-only. For the latest updates, please go here.

AvalonDock and MVVM CodeProject not working with latest AvalonDock

Jun 11, 2015 at 2:20 PM
I am trying to get the AvalonDockHost created in the Code Project article "AvalonDock and MVVM" (which uses AvalonDock 1.3) to work with the latest version of AvalonDock..

In my app I want to be able to have an arbitrary list of ViewModels of a certain class in my MainViewModel and show a pane for each. The tool in the article above seems to do exactly this.

The main problem I'm having at the moment is that the AvalonDockHost requires "DocumentContent" or DockableContent" in order to work. As far as I can see these are no longer present in AvalonDock.

Is there a way to get the AvalonDockHost working with the present version of AvalonDock or is there mayby a better way to handle this directly in AvalonDock?

Any help is greatly appreciated!
Jun 25, 2015 at 8:46 AM
To answer my own question I later realized that I didn't need AvalonDockHost as later versions of AvalonDock allows for MVVM by use of the AnchorableSource, DocumentSource and ActiveContent properties as described in the AvalonDock.MVVMTestApp.
    <avalonDock:DockingManager x:Name="dockManager" 
                               AnchorablesSource="{Binding Tools}" 
                               DocumentsSource="{Binding Files}"
                               ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}"
                               Grid.Row="1">
I haven't managed to get everything working as I'd like yet as my layout is quite different from the VS enviroment that AvalonDock is trying to recreate. But I must say I think this is a great tool!