2
Vote

AvalonDock 3.3: Serialization of hidden panels does not work

description

If I try to serialize the layout with two panels hidden the resulting XML will contain an element like this, which obviously is not valid XML and makes deserialization impossible.
  <Hidden AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Panel_1" ContentId="Panel_1" CanClose="False" PreviousContainerId="f5ef0b3f-a63b-4c9b-9e09-804485d56c53" PreviousContainerIndex="0" AutoHideMinWidth="100" AutoHideMinHeight="100" Title="Panel_2" ContentId="Panel_2" CanClose="False" PreviousContainerId="f5ef0b3f-a63b-4c9b-9e09-804485d56c53" PreviousContainerIndex="0" />
The DockingManager uses bindings to show/hide panels:
<xcad:DockingManager Grid.Row="1" x:Name="DockingManager" AnchorablesSource="{Binding Panels}" DocumentsSource="{Binding Documents}" AllowMixedOrientation="True" >
            <xcad:DockingManager.LayoutItemContainerStyleSelector>
                <avalonTest:LayoutItemStyleSelector>
                    <avalonTest:LayoutItemStyleSelector.PanelStyle>
                        <Style TargetType="{x:Type xcad:LayoutItem}">
                            <Setter Property="ContentId" Value="{Binding Model.DataContext.Text}"/>
                            <Setter Property="Title" Value="{Binding Model.DataContext.Text}"/>
                            <Setter Property="Visibility" Value="{Binding Model.DataContext.Visibility, Mode=TwoWay}"/>
                        </Style>
                    </avalonTest:LayoutItemStyleSelector.PanelStyle>
                    <avalonTest:LayoutItemStyleSelector.DocumentStyle>
                        <Style TargetType="{x:Type xcad:LayoutItem}">
                            <Setter Property="ContentId" Value="{Binding Model.Text}"/>
                            <Setter Property="Title" Value="Document"/>
                            <Setter Property="Visibility" Value="{Binding Model.Visibility}"/>
                        </Style>
                    </avalonTest:LayoutItemStyleSelector.DocumentStyle>
                </avalonTest:LayoutItemStyleSelector>
            </xcad:DockingManager.LayoutItemContainerStyleSelector>
        </xcad:DockingManager>

comments

BoucherS wrote Mar 20 at 12:14 PM

Hi,
This is already fixed.
The fix will be included in v3.4.