C#, WPF, AvalonDock v 4.0.0.0. I have got three AnchorablePanes
arranged vertically within a LayoutPanel
. When either splitter is first adjusted by the user, all three AnchorablePanes
abruptly change in height or vertical position. As far as I can see, what is happening this:
When a splitter is moved, the furthest AnchorablePane
(i.e. the one that should be unaffected by the move) collapses to its minimum height. The remaining two adjust to fill the space, retaining the correct height ratios relative to one another. i.e.
If the top splitter is moved, AnchorablePane
3 collapses and AnchorablePanes
1 and 2 expand to fill the space.
If the bottom splitter is moved, AnchorablePane
1 collapses and AnchorablePanes
2 and 3 expand to fill the space.
The AnchorablePanes
do not just collapse to fit the contents. In my real application they do have content, which gets obscured.
Once this has happened, behavior thereafter is normal. It is as if the initial display does not match the underlying parameters, so the first time it gets recomputed there is a correction.
Do we know what causes this or how to prevent it? The following minimal example demonstrates. Just run this and move either of the splitters.
<Window x:Class="TestAvalon.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock"
Title="MainWindow" Height="450" Width="800">
<Grid>
<dock:DockingManager x:Name = "Dockman">
<dock:LayoutRoot x:Name = "_layoutRoot" >
<dock:LayoutPanel Orientation="Vertical">
<dock:LayoutAnchorablePaneGroup Orientation="Vertical">
<dock:LayoutAnchorablePane>
<dock:LayoutAnchorable Title = "TEST PANE 1">
</dock:LayoutAnchorable >
</dock:LayoutAnchorablePane >
<dock:LayoutAnchorablePane>
<dock:LayoutAnchorable Title = "TEST PANE 2">
</dock:LayoutAnchorable >
</dock:LayoutAnchorablePane >
<dock:LayoutAnchorablePane>
<dock:LayoutAnchorable Title = "TEST PANE 3">
</dock:LayoutAnchorable >
</dock:LayoutAnchorablePane >
</dock:LayoutAnchorablePaneGroup>
</dock:LayoutPanel>
</dock:LayoutRoot >
</dock:DockingManager>
</Grid>
</Window>
using System.Windows;
namespace TestAvalon
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…