Docking Window Layout XAML Only

Docking/MDI for WPF Forum

Posted 14 years ago by Richard Sherman
Version: 9.2.0514
Avatar
Hi,

I am having trouble docking windows the way I want to using XAML only.
See code below.

I want to dock the "Properties" window to the bottom of the "Project View" window.
(one tool window docked to the bottom of the other, like visual studio has solution explorer and properties window is docked to the bottom)

Then to the right of that I want a workspace area and a tool window docked to the bottom of the workspace.(So the top half is the workspace area and the bottom half is a the "Data View" tool window)

I can create all the pieces just fine but can't figure out how to dock everything the way I want to just using XAML.

My other question is will the layout saving feature be able to remember all the docking states and positions?

<Grid>
        <docking:DockSite>
            
               
            <docking:SplitContainer>

                <docking:ToolWindowContainer>
                    <docking:ToolWindow Title="Project View" />
                    <docking:ToolWindow Title="Properties" />
                </docking:ToolWindowContainer>

                <!-- Workspace -->
                <docking:Workspace BorderBrush="#898C95"
                                   BorderThickness="1">
                    <docking:Workspace.Background>
                        <LinearGradientBrush EndPoint="0,1">
                            <GradientStop Offset="0.5"
                                          Color="#FFFFFF" />
                            <GradientStop Offset="1"
                                          Color="#D9F0FC" />
                        </LinearGradientBrush>
                    </docking:Workspace.Background>

                    <TextBlock>This is a Workspace</TextBlock>
                </docking:Workspace>

               
                    <docking:ToolWindowContainer>
                        <docking:ToolWindow Title="Data View" />
                    </docking:ToolWindowContainer>
                

            </docking:SplitContainer>

        </docking:DockSite>
    </Grid>

Thanks

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Richard,

This should be what you want:
<docking:DockSite>
    <docking:SplitContainer>
        <docking:SplitContainer Orientation="Vertical">
            <docking:ToolWindowContainer>
                <docking:ToolWindow Title="Project View" />
            </docking:ToolWindowContainer>
            <docking:ToolWindowContainer>
                <docking:ToolWindow Title="Properties" />
            </docking:ToolWindowContainer>
        </docking:SplitContainer>

        <docking:SplitContainer Orientation="Vertical">
            <!-- Workspace -->
            <docking:Workspace BorderBrush="#898C95"
                                   BorderThickness="1">
                <docking:Workspace.Background>
                    <LinearGradientBrush EndPoint="0,1">
                        <GradientStop Offset="0.5"
                                          Color="#FFFFFF" />
                        <GradientStop Offset="1"
                                          Color="#D9F0FC" />
                    </LinearGradientBrush>
                </docking:Workspace.Background>

                <TextBlock>This is a Workspace</TextBlock>
            </docking:Workspace>

            <docking:ToolWindowContainer>
                <docking:ToolWindow Title="Data View" />
            </docking:ToolWindowContainer>
        </docking:SplitContainer>
    </docking:SplitContainer>
</docking:DockSite>
Yes, the layout serialization will remember where tool windows are located.


Actipro Software Support

Posted 14 years ago by Richard Sherman
Avatar
Thanks, that worked.
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.