User control does not hide DockablePane after moving

Sep 8, 2011 at 12:23 PM

Code in user control:

<UserControl x:Class="Kurz1.ucDbTree"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <ad:DockablePane HorizontalAlignment="Left" Width="200">
        <ad:DockableContent x:Name="classesContent" Title="DB"/>
    </ad:DockablePane>
</UserControl>

Code in main window:

<Window xmlns:my="clr-namespace:Kurz1"  x:Class="Kurz1.dock1"
        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="dock1" Height="511" Width="783">
    <Grid>
        <ad:DockingManager x:Name="dockManager" Grid.Row="1" >
            <ad:ResizingPanel Orientation="Horizontal" Name="resPanel" >
            </ad:ResizingPanel>
        </ad:DockingManager>
    </Grid>
</Window>
Code behin in main window:
        public dock1()
        {
            InitializeComponent();

            resPanel.Children.Add(new ucDbTree());
        }
After moving docked window remains grey window in backgroud, so i see two windows.