Does the XamDockManager support a databound list of content? I want to build a drag-and-drop layout where the dockmanager is default to a two column layout and the user can drag and drop from another listbox or from within the dockmanager. Will the dockmanager also save the state of these panels using the DockManager SaveLayout method?
Hello,
I am just checking if you require any further assistance on the matter.
No, this hasn't been resolved. I am looking for a way to utilize the DockPanel to have a list of UserControls in two columns. Each column represents the docked left and docked right scenario as well as allows the user to drag and drop the controls area.
To answer the original question - no the xamDockManager is not a simple ItemsControl that is to be bound to a list of items. It is meant to provide the Visual Studio docking interface. As in VS, each pane is an independent entity that may be dragged around/manipulated - whether that is docked to an edge of the control, floating, unpinned, closed, etc. Also as with VS, the XamDockManager's docked panes are docked around some content. If you wanted a VS style tabbed document interface then that content would be a DocumentContentHost which would interact with the XDM and provide that tabbed document experience. Alternatively you can set the Content to anything else and that will essentially be opaque content that is surrounded by the docked panes (e.g. one might use a RichTextBox and the docked/floating panes contain various controls that augment/affect that rich text content). Lastly, one could set the LayoutMode to FillContainer in which case the last docked SplitPane will fill that central area where the content would have resided.
Also, the dragging of the xamDockManager is internal to the control so it doesn't support dragging from something else like a listbox as you asked about.
With regards to the SaveLayout that serializes out information about the ContentPanes and where they are positioned, etc.. Assuming the Name of the ContentPane instances are consistent then they would be restored to their expected/previous locations. The SaveLayout doesn't save any information other than its own layout information so it wouldn't be saving any information about whatever might be within the ContentPane's Content.
I'm not sure exactly what you are trying to accomplish but I suspect that the xamDockManager is not the appropriate UI for the scenario. If you really do want to pursure using it and want binding then you might review this post about how one might create ContentPane instances based on a given collection. Alternatively, you might look at other controls - e.g. a XamTilesManager which has a notion of dragging the tiles, maximizing tiles, etc. or some other ItemsControl derived class perhaps with your own custom ItemsPanel or custom behavior that will provide the dragging logic you want.