Josh Smith wrote a quintessential article on MVVM entitled, WPF Apps With The Model-View-ViewModel Design Pattern, for MSDN Magazine that was published in February 2009. In the article he shows a sample application that some some tabs and displays some content. Sounds pretty simple until you consider that the content of the tabs is dynamic and could be anything. The sample app demonstrates a little trick I thought was brilliant and made the entire article so eye-openning; using DataTemplates to bind the possible dynamic sources of Views and ViewModels together, allowing the page controller (host view model?) to simply maintain a bound collection of viewmodels and have the XAML do the figuring of what view to display. This is a fantastic example of Separation of Concerns.
Though I really loved the article, I wanted to leverage the UX functionality of the Infragistics DockManager control to give the user more flexibility in how they want to view the data being presented (especially in a multi-monitor scenario). Using the source code from Josh‘s article as a base and swapping out the TabControl he was using with Infragistics‘ DockManager control failed as there isn’t a way to natively bind the DockManager to the collection of ViewModels hosted in the page controller (host view model?). The support from Francis and Sam from Infragistics lead to soliciting help from Andrew Smith who graciously wrote a blog post entitled "ItemsSource for XamDockManager Elements" demonstrating how to accomplish the required binding. (Source code available here)
All of this culminates in the successful marryiage of the dynamic nature demonstrated in the MVVM pattern demonstrated in Josh‘s article with the flexibility of the Infragistics DockManager control. I have posted the sample source code here.
Many thanks need to be extended by myself and on behalf of the users of the application I am working on for the efforts of Francis, Sam, and Andrew from Infragistics as well as the ground-breaking of Josh for bringing this all together.