Why do AvalonDock panes collapse in height when splitters first moved?

C#, WPF, AvalonDock v 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.

enter image description here

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"
          Title="MainWindow" Height="450" Width="800">
          <dock:DockingManager x:Name = "Dockman">
              <dock:LayoutRoot x:Name = "_layoutRoot" >
                  <dock:LayoutPanel Orientation="Vertical">
                      <dock:LayoutAnchorablePaneGroup Orientation="Vertical">
                              <dock:LayoutAnchorable Title = "TEST PANE 1">
                              </dock:LayoutAnchorable >
                          </dock:LayoutAnchorablePane >
                              <dock:LayoutAnchorable Title = "TEST PANE 2">
                              </dock:LayoutAnchorable >
                          </dock:LayoutAnchorablePane >
                              <dock:LayoutAnchorable Title = "TEST PANE 3">
                              </dock:LayoutAnchorable >
                          </dock:LayoutAnchorablePane >
              </dock:LayoutRoot >

using System.Windows;

namespace TestAvalon

    public partial class MainWindow : Window
        public MainWindow()



Although I don’t know what was causing this behavior, or how to avoid it when using Xceed’s AvalonDock, I have got around the problem by using Dirkster’s AvalonDock fork. I am using version 4.50.2, and only minimal changes to code were required in order to switch between the two libraries. Dirkster’s AvalonDock does not exhibit the problem behavior described in the question.

Leave a Reply

Your email address will not be published. Required fields are marked *