There is a memory leak in AvalonDock v2.0.1746.
For demonstration of the memory leak I've modifed MVVMTestApp
In the project, all opened files are binded in first avalon dock (dockManager):
```
<avalonDock:DockingManager x:Name="dockManager"
AnchorablesSource="{Binding Tools}"
DocumentsSource="{Binding Files}"
ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}"
Grid.Row="1">
```
Instead of direct displaying content in TextBox, I've created user control FileView.
So, each opened file is displayed with user control FileView:
```
<local:PanesTemplateSelector.FileViewTemplate>
<DataTemplate>
<local:FileView />
</DataTemplate>
</local:PanesTemplateSelector.FileViewTemplate>
```
And FileView.xaml looks like this;
```
<UserControl x:Class="AvalonDock.MVVMTestApp.FileView"
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:avalonDock="http://avalondock.codeplex.com"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<avalonDock:DockingManager Name="fileAvalonDock">
<avalonDock:LayoutRoot>
<avalonDock:LayoutPanel>
<avalonDock:LayoutAnchorablePane>
<avalonDock:LayoutAnchorable>
<TextBox Text="{Binding TextContent, UpdateSourceTrigger=PropertyChanged}"/>
</avalonDock:LayoutAnchorable>
</avalonDock:LayoutAnchorablePane>
</avalonDock:LayoutPanel>
</avalonDock:LayoutRoot>
</avalonDock:DockingManager>
</Grid>
</UserControl>
```
As you can see there is another avalon docking manager(fileAvalonDock) in FileView with an anchor that contains textbox with content of the file.
When opened file is closed, it's docking manager (fileAvalonDock) is not destroyed ?
For demonstration of the memory leak I've modifed MVVMTestApp
In the project, all opened files are binded in first avalon dock (dockManager):
```
<avalonDock:DockingManager x:Name="dockManager"
AnchorablesSource="{Binding Tools}"
DocumentsSource="{Binding Files}"
ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}"
Grid.Row="1">
```
Instead of direct displaying content in TextBox, I've created user control FileView.
So, each opened file is displayed with user control FileView:
```
<local:PanesTemplateSelector.FileViewTemplate>
<DataTemplate>
<local:FileView />
</DataTemplate>
</local:PanesTemplateSelector.FileViewTemplate>
```
And FileView.xaml looks like this;
```
<UserControl x:Class="AvalonDock.MVVMTestApp.FileView"
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:avalonDock="http://avalondock.codeplex.com"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<avalonDock:DockingManager Name="fileAvalonDock">
<avalonDock:LayoutRoot>
<avalonDock:LayoutPanel>
<avalonDock:LayoutAnchorablePane>
<avalonDock:LayoutAnchorable>
<TextBox Text="{Binding TextContent, UpdateSourceTrigger=PropertyChanged}"/>
</avalonDock:LayoutAnchorable>
</avalonDock:LayoutAnchorablePane>
</avalonDock:LayoutPanel>
</avalonDock:LayoutRoot>
</avalonDock:DockingManager>
</Grid>
</UserControl>
```
As you can see there is another avalon docking manager(fileAvalonDock) in FileView with an anchor that contains textbox with content of the file.
When opened file is closed, it's docking manager (fileAvalonDock) is not destroyed ?