I was able to use your MVVM docking demo to get my application working, but, I would like to use Unity to resolve the view to the supplied view model instead of defining data templates. I have defined 4 permanent docking regions and i am trying to add new tabbed documents as per the example you provide. Here is the code that I am trying to use:
FrameworkElement view= viewLocator(viewModel); // Unity is used to resolve the view from the vm based on convention.
DockingManager.SetHeader(view, ((IDockElement)viewModel).Header);
DockingManager.SetState(view, DockState.Document);
dockingManager.Children.Add(view); // exception thrown here.
I get the following message thrown in mscorlib:
The Value "MyProduct.MyApp.Views.MyView" is not of type "System.Object" and cannot be used in this generic container.
The view is indeed a UserControl which does derive from System.Object. I don't understand how adding my Unity resolved control to the collection is different than adding a contentcontrol but evidently it is. Can someone please provide some insight? I see the wisdom in using the viewmodel to drive the GUI but, I would like to use Unity to resolve my views.
thanks in advance