Avalon Dock 2.0 LayoutItemTemplateSelector given ContentPresenter instead of ViewModel
I've been at this for weeks...I am creating a WPF application that uses Avalon Dock 2.0 in the the Main Window. I am trying to use the Docking Manager in a MVVM way, so I have DockingManager.DocumentsSource bound to an ObservableCollection<object> property in my MainViewModel . I also created a custom DataTemplateSelector and bound it to DockingManager.LayoutItemTemplateSelector . The problem I am having: I add a ViewModel to the documents source. My custom DataTemplateSelector.SelectTemplate() is called. The item parameter in SelectTemplate() is a System.Windows.Controls.ContentPresenter