我在 .NET 3.5 上使用 AvalonDock v 1.3。
我在设计时向 DockingManager 添加了两个文档窗格。第一个设置为可见,第二个设置为隐藏/折叠(参见下面的Visibility="Collapsed")。
当我启动应用程序时,第二个文档窗格不可见,这是预期的行为,但不幸的是,尽管将 HorizontalAlignment 设置为“拉伸”,但可见文档面板并未显示为拉伸到主窗口的边缘。我将如何将此剪辑(或最大化)到允许区域的边缘?
这是我正在使用的 xaml:
<ad:DockingManager x:Name="dockManager" Grid.Row="1">
<ad:ResizingPanel Name="resizePanel" Orientation="Horizontal">
<ad:DocumentPane Name="visibleDocumentPane" HorizontalAlignment="Stretch" >
<ad:DocumentContent Title="A"/>
<ad:DocumentContent Title="B"/>
</ad:DocumentPane>
<ad:DocumentPane Name="collapsedDocumentPane" Visibility="Collapsed">
<ad:DocumentContent Title="A"/>
<ad:DocumentContent Title="B"/>
</ad:DocumentPane>
</ad:ResizingPanel>
</ad:DockingManager>
谢谢,戴夫
根据要求,这是完整的 XAML:
<Window x:Class="AvalonDockSampleProject.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="MainWindow" Height="421" Width="948">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="24"/>
<RowDefinition Height="*"/>
<RowDefinition Height="24"/>
</Grid.RowDefinitions>
<Menu>
<MenuItem Header="File">
<MenuItem Header="Create DockableContent" Click="CreateDockableContent"/>
<MenuItem Header="Layout">
<MenuItem Header="Save" Click="SaveLayout"/>
<MenuItem Header="Restore" Click="RestoreLayout"/>
</MenuItem>
<MenuItem Header="Exit"/>
</MenuItem>
</Menu>
<ad:DockingManager x:Name="dockManager" Grid.Row="1">
<ad:ResizingPanel Name="resizePanel" Orientation="Horizontal">
<ad:DocumentPane Name="visibleDocumentPane" HorizontalAlignment="Stretch" >
<ad:DocumentContent Title="A!"/>
<ad:DocumentContent Title="B!"/>
</ad:DocumentPane>
<ad:DocumentPane Name="collapsedDocumentPane" Visibility="Collapsed">
<ad:DocumentContent Title="A"/>
<ad:DocumentContent Title="B"/>
</ad:DocumentPane>
</ad:ResizingPanel>
</ad:DockingManager>
<StatusBar Grid.Row="2">
<StatusBarItem Content="AvalonDock 1.3 Sample Project"/>
</StatusBar>
</Grid>
</Window>