This example shows how to build a dock UI using the MVVM pattern.
To learn more on how to implement similar functionality in Silverlight, refer to the T245345 example.
Question Comments
Added By: David Lemieux at: 12/3/2013 5:38:24 AM
How come the view should be responsible of creating documents and panels? In a true MVVM design this should be the ViewModel's responsibility.
Added By: David Lemieux at: 12/5/2013 8:17:17 AMIs anyone from DevExpress monitoring comments on examples?
Added By: Alex Zeller (DevExpress) at: 12/6/2013 5:07:00 AMHello David,
The View only creates root containers where dock panels are placed. This is a required step of creating the Docking UI.
Alex, I was refering to MainWindow.xaml.cs file. It has AddPanel_Click and AddDocument_Click methods, in which view models instances are created.
If the purpose of the example is to demonstrate how DX docking can be used with the MVVM pattern, then the DockLayoutManagerViewModel class should be responsible for creating / adding documents. Giving this responsibility to the view class goes straight against MVVM design rules, IMHO.
Added By: Alex Zeller (DevExpress) at: 12/17/2013 4:34:14 AMDavid, you're right. We have moved the code that creates Panels and Documents to View Models.
Added By: David Lemieux at: 12/17/2013 5:16:25 AMThanks. You might want to clean up MainPage's code too. The DockLayoutManagerViewModel is instanciated in both the XAML and code behind. ;)
Added By: Raju Muthu at: 1/6/2014 12:04:12 PMCan this example extended to using PRISM regions? or is there an example already with this feature utilizing Prism?
Added By: Gagan Kapoor at: 2/1/2014 2:54:16 PMHi, I need a dock UI with ability to host different types of views in Document Group (Tabs) at run time using Prism. Can you point me to an example of it ?
Added By: Michael Ch (DevExpress Support) at: 5/22/2015 12:15:40 AMHello Raju and Gagan,
We accidentally discovered that your initial posts were out of scope of our Support Center for a long time. Please accept our sincere apologies for not responding in a timely manner.
We have few samples showing of how to use the DXDocking suite with the Prism framework. Below is a list of them. Please take a moment to review them and let us know if you have additional questions.
1. Using DXDocking for WPF in accordance with Composite Application Guidelines
2. How to use the DXDocking and DXBars components with Prism
3. Prism - How to define Prism regions for various DXDocking elements
Thanks,
Michael
Hello,
I've been working on this sample but I have a question. How do you add a new mvvm view in a document ? For exemple a CustomerViewModel.... this is a plain sample documentViewModel1.Content = "Document View Model"; I've looking
for an easy sample to understand but I don't find anything...
Thank you!