One very strong MSDN article on MVVM from Josh Smith contains a sample that dynamically adds tabs to a content section of a tab control. One of the keys to this article is the DataTemplating that ties the ViewModel of the observable collection to the view to be represented, thus allowing the dynamic addition and removal of content in the tab control.
I am looking to perform the same thing, but with the DocumentContentHost of the DockManager, dynamically adding/removing ContentPanes based on the collection of detail ViewModels. Has anyone successfully been able to accomplish something like this?
<StrugglingButPersistent>JH</StrugglingButPersistent>
I have resolved the issue. The result (and sample code) can be found here.
Hi Jason,
I'm looking at your sample (MVVMDockManager) but can't get the SetActiveWorkspace function to work.. can you help?
ruicarlos,
Your question is a bit vague. What about it can you not get to work?
In the sample, run the application, then click View > Control Panel and click on either of the links ("View all customers" or "Create new customer") and the SetActiveWorkspace method is called.
HTH,
JH