This topic covers two ways to building a dock UI using the MVVM design pattern.
Implementing the IMVVMDockingProperties interface - the most common solution; in this approach, each ViewModel should implement the IMVVMDockingProperties interface.
Using the LayoutAdapter - the approach is suitable for advanced tasks, which require dock panels to be placed in positions that cannot be addressed beforehand.
In these two solutions, you assign a collection of ViewModels, which represent dock panels, to the DockLayoutManager.ItemsSource property. For each object in this collection, a dock panel is to be created.
The difference between the solutions is in specifying "targets" for dock panels. In DXDocking, "target" is a specific Layout Group or Document Group where the dock panel is placed.
With this approach, the View Models (for dock panels) can be any object descendants.
Using the LayoutAdapter is appropriate for tasks that require additional customizations.
For instance, in some cases, you may not be able to identify a target Layout Group/Document Group for a created dock panel beforehand (e.g. , if the target Layout Group/Document Group does not currently exist). In this case, you need to create the target Group before adding panels to it. The LayoutAdapter class provides a solution to these and other issues that require additional actions to be performed prior to dock panel lay-outing.
The following are steps needed for using the LayoutAdapter.
Create a LayoutAdapter class, which is an object that implements the ILayoutAdapter interface.
The Resolve method should return the name of a "target" Layout Group/Document Group for a specific dock panel (passed as the item parameter). When implementing the Resolve method you are able to perform any action prior to returning a target name.
Assign a LayoutAdapter instance to the MVVMHelper.LayoutAdapter attached property on the DockLayoutManager.