title: Avalon Dock[2]: After re-loading layout from file, cannot hide/show LayoutAnchorable
body: <p>I got a simple Avalon Dock application. With a test button I can hide and show an LayoutAnchorable in codebehind. Works fine!
  But after saveing and re-loading the layout to disk the call <strong>Hide()/Show()</strong> are ignored, no exception, nothing.</p>
  
  <p>Any ideas? Thanks for your help!     Haimo</p>
  
  <p>Here is the XAML:</p>
  
  <pre><code>&lt;Window x:Class="AvalonDockTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:AvalonDockTest" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
      xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" Title="MainWindow"
      Width="700" Height="450"
      mc:Ignorable="d"&gt;
  &lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="Auto" /&gt;
          &lt;RowDefinition Height="*" /&gt;
      &lt;/Grid.RowDefinitions&gt;
  
      &lt;Button x:Name="button" Width="75"
              HorizontalAlignment="Left" Click="OnTestClick"
              Content="Test" /&gt;
  
      &lt;xcad:DockingManager x:Name="_dockMan" Grid.Row="1"
                           MaxHeight="425" AllowMixedOrientation="True"
                           BorderBrush="Black" BorderThickness="1"
                           Theme="{Binding ElementName=_themeCombo,
                                           Path=SelectedItem.Tag}"&gt;
  
          &lt;xcad:LayoutRoot x:Name="_layoutRoot"&gt;
              &lt;xcad:LayoutPanel Orientation="Horizontal"&gt;
                  &lt;xcad:LayoutAnchorablePane DockWidth="200"&gt;
                      &lt;xcad:LayoutAnchorable x:Name="_layoutProp" Title="Properties"
                                             AutoHideWidth="240" CanClose="False"
                                             CanHide="False" ContentId="_idProperties"&gt;
                          &lt;TextBlock Margin="20" Text="Properties Layout" /&gt;
                      &lt;/xcad:LayoutAnchorable&gt;
                  &lt;/xcad:LayoutAnchorablePane&gt;
  
                  &lt;xcad:LayoutDocumentPaneGroup&gt;
                      &lt;xcad:LayoutDocumentPane&gt;
                          &lt;xcad:LayoutDocument Title="Document 1" ContentId="document1"&gt;
                              &lt;Button HorizontalAlignment="Center" VerticalAlignment="Center"
                                      Content="Document 1 Content" /&gt;
                          &lt;/xcad:LayoutDocument&gt;
                      &lt;/xcad:LayoutDocumentPane&gt;
                  &lt;/xcad:LayoutDocumentPaneGroup&gt;
  
                  &lt;xcad:LayoutAnchorablePaneGroup DockWidth="180"&gt;
                      &lt;xcad:LayoutAnchorablePane&gt;
                          &lt;xcad:LayoutAnchorable Title="Alarms" ContentId="alarms"&gt;
                              &lt;ListBox&gt;
                                  &lt;s:String&gt;Alarm 1&lt;/s:String&gt;
                                  &lt;s:String&gt;Alarm 2&lt;/s:String&gt;
                                  &lt;s:String&gt;Alarm 3&lt;/s:String&gt;
                              &lt;/ListBox&gt;
                          &lt;/xcad:LayoutAnchorable&gt;
                      &lt;/xcad:LayoutAnchorablePane&gt;
                  &lt;/xcad:LayoutAnchorablePaneGroup&gt;
              &lt;/xcad:LayoutPanel&gt;
  
          &lt;/xcad:LayoutRoot&gt;
      &lt;/xcad:DockingManager&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>And this is the CodeBehind:</p>
  
  <pre><code>// ---------- code behind -----
  using System;
  using System.Windows;
  using Xceed.Wpf.AvalonDock.Layout.Serialization;
  
  namespace AvalonDockTest
  {
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
              this.Closing += MainWindow_Closing;
              LoadLayout();
          }
  
          private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
          {
              SaveLayout();
          }
  
          private void OnTestClick(object sender, RoutedEventArgs e)
          {
              if (_layoutProp.IsHidden)     // toggle the LayoutAnchorable
                  _layoutProp.Show();     
              else 
                  _layoutProp.Hide();
          }
  
          private void SaveLayout()
          {
              var layoutSerializer = new XmlLayoutSerializer(_dockMan);
              layoutSerializer.Serialize("layout.xml");
          }
          private void LoadLayout()
          {
              var layoutSerializer = new XmlLayoutSerializer(_dockMan);
              layoutSerializer.Deserialize("layout.xml");
          }
      }
  }
  </code></pre>