diff --git a/source/AvalonDocPanelMemoryLeaks/MainWindow.xaml.cs b/source/AvalonDocPanelMemoryLeaks/MainWindow.xaml.cs
index e83424d5..2689d8b8 100644
--- a/source/AvalonDocPanelMemoryLeaks/MainWindow.xaml.cs
+++ b/source/AvalonDocPanelMemoryLeaks/MainWindow.xaml.cs
@@ -27,10 +27,13 @@ public MainWindow()
InitializeComponent();
}
+ public HeavyLoad HeavyLoad { get; private set; }
+
private void Button_Click(object sender, RoutedEventArgs e)
{
UserControl content = new UserControl();
- content.DataContext = new HeavyLoad();
+ HeavyLoad = new HeavyLoad();
+ content.DataContext = HeavyLoad;
LayoutDocument docDocument = new LayoutDocument();
docDocument.Content = content;
docGrup.Children.Add(docDocument);
@@ -39,6 +42,7 @@ private void Button_Click(object sender, RoutedEventArgs e)
private void DocClosed(object sender, EventArgs e)
{
+ HeavyLoad.Load = null;
GC.Collect();
}
}
diff --git a/source/Components/AvalonDock.Themes.Aero/Theme.xaml b/source/Components/AvalonDock.Themes.Aero/Theme.xaml
index da765898..11455974 100644
--- a/source/Components/AvalonDock.Themes.Aero/Theme.xaml
+++ b/source/Components/AvalonDock.Themes.Aero/Theme.xaml
@@ -1008,6 +1008,8 @@