我是 WPF 新手并开始使用 Avalon Dock。我的工具栏有问题。当我在工具栏托盘中拖动工具栏时,托盘向下扩展并卡在 Avalon Dock 容器后面。我如何使其自动重新调整大小,以便工具栏不会卡在后面?这是我的 XAML .. 谢谢:)
<Window x:Class="PSWPF0._001.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:avalonDock="http://avalondock.codeplex.com"
Title="MainWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="381" d:DesignWidth="754" SizeToContent="WidthAndHeight">
<Grid DataContext="{Binding}" AllowDrop="True" ClipToBounds="True" IsItemsHost="False">
<DockPanel HorizontalAlignment="Stretch" Margin="2,0,0,0" Name="dockPanel1" VerticalAlignment="Stretch" />
<Menu Height="22" HorizontalAlignment="Stretch" Name="menu1" VerticalAlignment="Top" Margin="2,0,-2,0" DockPanel.Dock="Top">
<MenuItem Header="File">
<MenuItem Header="New" Click="MenuItem_Click_4">
<MenuItem Header="Project" />
<MenuItem Header="C Source File" />
<MenuItem Header="Text File" />
</MenuItem>
<MenuItem Header="Open" Click="MenuItem_Click_5"/>
<MenuItem Header="Save" />
</MenuItem>
<MenuItem Header="Edit">
<MenuItem Header="Undo" />
<MenuItem Header="Redo" />
<Separator />
<MenuItem Header="Copy" />
<MenuItem Header="Cut" />
<MenuItem Header="Paste" />
<MenuItem Header="Delete" />
<Separator />
<MenuItem Header="Find" />
</MenuItem>
<MenuItem Header="View" Click="MenuItem_Click_1">
<MenuItem Header="Project Dashboard"/>
<MenuItem Header="Project Explorer" />
</MenuItem>
<MenuItem Header="Help" Click="MenuItem_Click">
<MenuItem Header="About" Click="MenuItem_Click_3"/>
<MenuItem Command="ApplicationCommands.Help" Header="Help Content" />
</MenuItem>
</Menu>
<ToolBarTray DockPanel.Dock="Top" Background="LightGray" VerticalAlignment="Top" Margin="2,23,-2,0">
<ToolBar Band="1" BandIndex="1">
<Button>New</Button>
<Button>Open</Button>
<Button>Exit</Button>
</ToolBar>
<ToolBar BandIndex="2" Band="2">
<Button>Undo</Button>
<Button>Redo</Button>
</ToolBar>
<ToolBar Band="2" BandIndex="2">
<Button>Paint</Button>
<Button>Spaell</Button>
<Separator />
<Button>Cut</Button>
<Button>Copy</Button>
<Button>Paste</Button>
<Separator />
<Button>Find</Button>
<Button>Replace</Button>
</ToolBar>
</ToolBarTray>
<avalonDock:DockingManager x:Name="dockingManager" Margin="0,52,0,28" VerticalAlignment="Stretch" DockPanel.Dock="Top" Grid.Column="0" AllowMixedOrientation="True" IsManipulationEnabled="False" UseLayoutRounding="True">
<avalonDock:LayoutRoot>
<avalonDock:LayoutPanel Orientation="Vertical">
<avalonDock:LayoutDocumentPaneGroup DockMinHeight="70">
<avalonDock:LayoutDocumentPane>
<avalonDock:LayoutDocument Title="Doc1">
<TextBox/>
</avalonDock:LayoutDocument>
<avalonDock:LayoutDocument Title="Doc2">
<TextBox/>
</avalonDock:LayoutDocument>
</avalonDock:LayoutDocumentPane>
<avalonDock:LayoutDocumentPane >
</avalonDock:LayoutDocumentPane>
</avalonDock:LayoutDocumentPaneGroup>
<avalonDock:LayoutAnchorablePaneGroup IsMaximized="True" DockMinHeight="70" DockHeight="250">
<avalonDock:LayoutAnchorablePane>
<avalonDock:LayoutAnchorable Title="Output">
<RichTextBox/>
</avalonDock:LayoutAnchorable>
<avalonDock:LayoutAnchorable Title="Error List">
<TextBox/>
</avalonDock:LayoutAnchorable>
</avalonDock:LayoutAnchorablePane>
</avalonDock:LayoutAnchorablePaneGroup>
</avalonDock:LayoutPanel>
<avalonDock:LayoutRoot.RightSide>
<avalonDock:LayoutAnchorSide>
<avalonDock:LayoutAnchorGroup>
<avalonDock:LayoutAnchorable Title="Properties" AutoHideMinWidth="200">
<RichTextBox/>
</avalonDock:LayoutAnchorable>
<avalonDock:LayoutAnchorable Title="Project Explorer" AutoHideMinWidth="200">
<RichTextBox/>
</avalonDock:LayoutAnchorable>
<avalonDock:LayoutAnchorable Title="File Explorer" AutoHideMinWidth="200">
<RichTextBox/>
</avalonDock:LayoutAnchorable>
</avalonDock:LayoutAnchorGroup>
</avalonDock:LayoutAnchorSide>
</avalonDock:LayoutRoot.RightSide>
<avalonDock:LayoutRoot.LeftSide>
<avalonDock:LayoutAnchorSide>
<avalonDock:LayoutAnchorGroup>
<avalonDock:LayoutAnchorable Title="Project Dashboard" AutoHideMinWidth="200">
<RichTextBox/>
</avalonDock:LayoutAnchorable>
<avalonDock:LayoutAnchorable Title="Hardware Toolbox" IsMaximized="True" CanAutoHide="True" IsActive="True" AutoHideMinWidth="200">
<ListBox/>
</avalonDock:LayoutAnchorable>
<avalonDock:LayoutAnchorable Title="Logic Building Blocks" AutoHideMinWidth="200">
<RichTextBox/>
</avalonDock:LayoutAnchorable>
</avalonDock:LayoutAnchorGroup>
</avalonDock:LayoutAnchorSide>
</avalonDock:LayoutRoot.LeftSide>
</avalonDock:LayoutRoot>
</avalonDock:DockingManager>
<StatusBar Height="22" HorizontalAlignment="Stretch" Margin="2,322,0,0" Name="statusBar1" VerticalAlignment="Bottom" DockPanel.Dock="Bottom"/>
</Grid>