Set Height of Dockable ToolBar Section

Dec 23, 2008 at 11:47 PM
Hi.

I'm using AvalonDock in my WPF Application to allow for moving and docking sections of my MainWindow.
I have a Menu section that's not in the <DockingManager> and then I have a ToolBar and TextBox in the <DockinManager>.
My ToolBar is displaying in about 1/3 of the Window and the TextBox displays in the other 2/3 of the Window.

I only want my ToolBar to have a height of about 60 (Height="60").
I tried adding Height="60" to the ToolBar element, DockablePanel element (not at the same time) but it made no difference.

Is there a way to change the height of one of my sections?

Here's my XAML code.

<

Window x:Class="MainWindow"
xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
Title="AvalonDock Test RG" Height="800" Width="800" WindowStartupLocation="CenterScreen" >
    <DockPanel LastChildFill="True" >
        <DockPanel.LayoutTransform>
               
<ScaleTransform ScaleX="1" ScaleY="1" />
       
</DockPanel.LayoutTransform>

 

 

        <!-- Menu Items -->
       
<Menu DockPanel.Dock="Top">
           
<MenuItem Header="File" Click="FileExit_Click">
        </Menu>
       
<ad:DockingManager x:Name="dockManager">
           
<ad:ResizingPanel Orientation="Vertical">
              
<ad:DockablePane>
                  
<ad:DockableContent Name="dcToolBar" Title="ToolBar">
                      
<ToolBar>
                           
<Button Content="Close" Click="FileExit_Click" />
                           
<Separator/>
                           
<Button Content="Print" Click="Print_Click" />
                           
<Separator/>
                      
</ToolBar>
                 
</ad:DockableContent>
             
</ad:DockablePane>
           
<ad:DockablePane>
               
<ad:DockableContent Title="TextBox1">
                   
<TextBox />
               
</ad:DockableContent>
            
</ad:DockablePane>
         
</ad:ResizingPanel>
     
</ad:DockingManager>
 
</DockPanel>
</
Window>

Any suggestions will be greatly appreciated!

 

Dec 24, 2008 at 2:27 PM
Try setting attached property that informs parent ResizingPanel that control wants described height.

            <ad:ResizingPanel Orientation="Vertical">
               <ad:DockablePane ad:ResizingPanel.Height="60">
Dec 29, 2008 at 3:36 PM
Thank you Zintus! That worked perfectly.