Restricting the Docking for the Tool Window in same Docsite

Docking/MDI for WPF Forum

Posted 12 years ago by keshav bansal
Avatar
Hi,

I am using the Actipro tool for Docking requirement in our project and facing little bit problem.

1. Docksite consists of three toolwindows and i want to block the docking for the toolwindow in the another toolwindow with in the same docksite and allow docking in another third tool window.


For Example: My Docksite consists two tool windows(toolwindow1 and toolwindow2,toolwindow3) and i can easily dock the toolwindow1 in the toolwindow2 and toolwindow3 vice versa also.I want to block the docking for the toolwindow1 in the toolwindow2 and allow docking in the tool window3.


Using the Code :-


<Window x:Class="DockingApplication.MainWindow"
xmlns:Common="clr-namespace:DockingApplication"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking"
Title="MainWindow">
<Grid>
<DockPanel LastChildFill="True">
<docking:SplitContainer Orientation="Vertical">
<docking:DockSite x:Name="dockSite" CanDocumentWindowsRaft="True" CanToolWindowsAttach="False">
<docking:SplitContainer Orientation="Vertical" >
<docking:SplitContainer>

<docking:ToolWindowContainer >
<Common:AblationView x:Name="win1" Title="AblationView" />
</docking:ToolWindowContainer>
<docking:ToolWindowContainer >
<Common:VitalsView x:Name="win2" Title="VitalsView" />
</docking:ToolWindowContainer>
</docking:SplitContainer>
<docking:Workspace Height="Auto">
<Button Height="30" Width="100" Name="vbutoton" Background="Red">Waveform View</Button>

</docking:Workspace>
<docking:ToolWindowContainer Height="Auto" >
<Common:StatusView x:Name="win3" Drop="win3_Drop" CanAttach="False" Title="StatusView" />
</docking:ToolWindowContainer>
</docking:SplitContainer>

</docking:DockSite>

</docking:SplitContainer>
</DockPanel>
</Grid>
</Window>

Comments (3)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Keshav,

Sorry, but that is not currently possible. You would either have to restrict it from docking with any ToolWindow, or allow it to dock with any ToolWindow.

Depending on what you are trying to achieve, you could probably use a second DockSite in the Workspace. You'd define your 3rd ToolWindow in the outer DockSite, the 1st and 2nd in the inner DockSite (as well as your actual Workspace with the button). This would allow you to move the 3rd TW around the inner DockSite, but not within it, while still allow the 1st and 2nd to be docked together or separately.


Actipro Software Support

Posted 12 years ago by keshav bansal
Avatar
Hi,

I am getting the same problem if i use the second docksite in the workspace and define the 3rd Toolwindow in the second docksite and 1st and 2nd Toolwindows in the first docksite.I can move the 3rd toolwindow arround the inner docksite and still i am not able to block the docking of the 3rd toolwindow in the first and second toolwindow means while dragging the 3rd toolwindow dockguide in the 1st and 2nd toolwindow is visible that should not happen.I wnat to block the dockguide or the docking for the 3rd toolwindow in the 1st and 2nd toolwindow.

Code :
<DockPanel LastChildFill="True">
<docking:SplitContainer Orientation="Vertical">
<docking:DockSite x:Name="dockSite1" CanDocumentWindowsRaft="True" CanToolWindowsAttach="False">
<docking:SplitContainer Orientation="Vertical" >
<docking:SplitContainer>

<docking:ToolWindowContainer >
<Common:AblationView x:Name="win1" Title="AblationView" />
</docking:ToolWindowContainer>
<docking:ToolWindowContainer >
<Common:VitalsView x:Name="win2" Title="VitalsView" />
</docking:ToolWindowContainer>
</docking:SplitContainer>
<docking:Workspace Height="Auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Height="30" Width="100" Name="vbutoton" Background="Red">Waveform View</Button>
<docking:DockSite x:Name="dockSite2" Grid.Row="1" >
<docking:ToolWindowContainer Height="Auto" >
<Common:StatusView x:Name="win3" Drop="win3_Drop" VerticalAlignment="Bottom" Title="StatusView" />
</docking:ToolWindowContainer>
</docking:DockSite>
</Grid> </docking:Workspace>

</docking:SplitContainer>

</docking:DockSite>
</docking:SplitContainer>
</DockPanel>


//Linking the dockSite1 and dockSite2 in the constructor of the MainWindow
public MainWindow()
{
InitializeComponent();
this.dockSite2.LinkDockSite(this.dockSite1);
}
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Keshav,

You cannot link the DockSites, as we said restricting the targets like you described is not supported. The proposed solution would have one TW in the outer DockSite, and two in the inner DockSite. If they are not linked, then the user would not be able to dock the inner TWs with the outer TW. But this approach also has the effect of requiring the outer TW to always be on the outside of the other two TWs.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.