I have detect a memory leak in the zoombox component. I have see through Ants profiler that the control is kept in memory by its keybindings even if the control is not in the visual tree.
I have made a small test to reproduce this behaviour :
* Build a windows like this :
```
<Window x:Class="ZoomboxTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpftoolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<Button Content="Click Me" Click="Button_Click"/>
<ContentControl x:Name="Control">
<wpftoolkit:Zoombox/>
</ContentControl>
</StackPanel>
</Window>
```
* Change the Control content when the button is clicked :
```
private void Button_Click(object sender, RoutedEventArgs e)
{
Control.Content = new Button();
}
```
The quick and dirty turnaround that i have found is to clear the CommandBinding collection before removing the control from the visual tree
I have made a small test to reproduce this behaviour :
* Build a windows like this :
```
<Window x:Class="ZoomboxTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wpftoolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<Button Content="Click Me" Click="Button_Click"/>
<ContentControl x:Name="Control">
<wpftoolkit:Zoombox/>
</ContentControl>
</StackPanel>
</Window>
```
* Change the Control content when the button is clicked :
```
private void Button_Click(object sender, RoutedEventArgs e)
{
Control.Content = new Button();
}
```
The quick and dirty turnaround that i have found is to clear the CommandBinding collection before removing the control from the visual tree