Good day
We are trying to create something similar to VS with the tabbed view in the center and property panes on the side and so forth.
We have three split panes
<xDock:XamDockManager Name="mainDockManager" PaneDragOver="mainDockManager_PaneDragOver"> <xDock:XamDockManager.Panes> <xDock:SplitPane Name="splitpaneRight" xDock:XamDockManager.InitialLocation="DockedRight"> <!--Content will be added dynamically by menuitem events--> </xDock:SplitPane> <xDock:SplitPane Name="splitpaneBottom" xDock:XamDockManager.InitialLocation="DockedBottom"> <!--Content will be added dynamically by menuitem events--> </xDock:SplitPane> </xDock:XamDockManager.Panes> <xDock:DocumentContentHost> <xDock:SplitPane> <xDock:TabGroupPane Name="tabGroupPane" FlowDirection="LeftToRight"> <!--Content will be added dynamically by menuitem events--> </xDock:TabGroupPane> </xDock:SplitPane> </xDock:DocumentContentHost> </xDock:XamDockManager>
and we add panes in tabs to the tabGroupPane. We want to allow the tabs to be move around in the center split pane and so on, but prevent the user from placing the panes in the right and bottom panes.
I tried using the PaneDragOver event, but could not determine over which split pane the user was dragging the pane. Any ideas?
Regards
Christo
If you only want the panes within the DocumentContentHost to be documents (and not allow them to be docked anywhere else - i.e. not docked left/right/top/bottom) then you could set the AllowDocking property to false. If you want to allow docking of those documents but specifically exclude those two split panes then you would need to evaluate the DragAction of the PaneDragOver event and upcast as needed to the appropriate derived drag action (e.g. AddToGroupActionBase). Then you would probably need to look at the relevant property (e.g. AddToGroupActionBase's Group property). If that element or an ancestor (which could be checked using something like LogicalTreeHelper.GetParent and walking up the parent chain) is the element you want to ignore then you would set the eventarg's IsValidDragAction to false.