My app has a toolbar that uses the Infragistics drag drop framework and xamdockmanager. The tools allow the user to drag a display, plot or other UI widget to the dock manager. From there on out the dock manager provides the UI for the layout of the items, each in their own content pane. This works incredibly well and with a bt of styling provides a nice customizable UI for the user.
One thing it doesn't do though is show (and use) the docking indicators as a new tool is dragged to the dock manager. If no panes are open in the dock manager, the dock manger itself is a drop target and creates a new splitpane and content pane forthe tool. If there are panes shown then each one of them is a drop target that adds the new widgets pane to the target split pane.
Works well enoguh but isn't nearly as intutive as if the docking indicators were shown if the tool were a real content pane.
How might I achieve showing the docking indicators when dragging one of my display widgets on to the dock manager?
Hello dcg1212,
Thank you for your post.
The built-in docking indicator for the XamDockManager is handled internally in the source code for the control, and it expects a type of pane to be dragged to it to perform the built-in docking operations. However, the namespace that contains the XamDockManager also contains a copy of this docking indicator as an object named DockingIndicator.
I would recommend using this docking indicator and keep its visibility set to Collapsed until you being dragging your UI widget from your toolbar. This docking indicator is made up of CardPanels that represent the docking areas. If you were to add a Style to the DockingIndicator.Resources that targets a CardPanel, you could utilize the Infragistics Drag-Drop Framework to make the card panels that represent the docking areas into drop targets. Then, by handling the Drop event on the element that you are dragging, you can check the drop-target card-panels name (which will contain either "Left, Right, Top, or Bottom"), create a pane, and dock it and place your UI widget inside of the pane accordingly. Then, set the visibility of the docking indicator back to collapsed.
I have created a sample project to demonstrate the above to you. It is attached to this post.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Just checking in, did you have any other questions or concerns on this matter?
thanks Andrew, this got to the back burner. I got it mostly working the way I'd like, except for the initial drop operation. That still just drops the selected item on other panels without showing the docking indicators. It needs more work, but remains on the back burner for now.