Hello,
In my application I add a usercontrol containing raddocking to the visual tree. When I remove this usercontrol from the visual tree it stays in memory because it seems that raddocking still has a reference to something. See example code below.
In my application I add a usercontrol containing raddocking to the visual tree. When I remove this usercontrol from the visual tree it stays in memory because it seems that raddocking still has a reference to something. See example code below.
| <UserControl xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" x:Class="UserControl1" |
| 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" |
| mc:Ignorable="d" |
| d:DesignHeight="300" d:DesignWidth="300"> |
| <Grid> |
| <my:RadDocking></my:RadDocking> |
| </Grid> |
| </UserControl> |
| <Window x:Class="MainWindow" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| Title="MainWindow" Height="350" Width="525"> |
| <Grid> |
| <DockPanel Name="DockPanel1"> |
| <StackPanel Orientation="Horizontal" DockPanel.Dock="top" HorizontalAlignment="Center" VerticalAlignment="Top" > |
| <Button Name="Add" Click="Add_Click" Margin="5">Add</Button> |
| <Button Name="Remove" Click="Remove_Click" Margin="5" >remove</Button> |
| </StackPanel> |
| </DockPanel> |
| </Grid> |
| </Window> |
| Class MainWindow |
| Private uc As New UserControl1 |
| Private Sub Add_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) |
| If Not DockPanel1.Children.Contains(uc) Then |
| DockPanel1.Children.Add(uc) |
| End If |
| End Sub |
| Private Sub Remove_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) |
| If DockPanel1.Children.Contains(uc) Then |
| DockPanel1.Children.Remove(uc) |
| End If |
| uc = Nothing |
| End Sub |
| End Class |