This question is locked. New answers and comments are not allowed.
Hello,
What is the correct pattern for dynamically loading new user controls in a RadPane window?
I have a RadRibbonView that I'm using and depending on the button clicked - I dynamically load a new user control into a targeted RadPane by assigning the new user control to the Content property. Pretty basic and it seems to work. The problem is that the previous user control never gets unloaded or free'd up and my memory usage sky rockets as you click the buttons and new controls are loaded.
I have a very simple setup inside a RadSplitContainer:
In the code behind I have a reference to the RadPane and I assign the new UserControl to the content of the RadPane:
The behavior is correct and the new user control is loaded into the RadPane, however it seems that the previous UserControl that was in there is never actually unloaded and certainly doesn't ever get free'd from memory (even calling GC.Collect).
Is there something I have to do to unload the previous Pane from the RadPaneGroup? I'm not sure what the correct pattern is here to make sure the previous UserControl is properly unloaded from memory...
Thanks!
Chris
What is the correct pattern for dynamically loading new user controls in a RadPane window?
I have a RadRibbonView that I'm using and depending on the button clicked - I dynamically load a new user control into a targeted RadPane by assigning the new user control to the Content property. Pretty basic and it seems to work. The problem is that the previous user control never gets unloaded or free'd up and my memory usage sky rockets as you click the buttons and new controls are loaded.
I have a very simple setup inside a RadSplitContainer:
<
telerik:RadSplitContainer
telerik:ProportionalStackPanel.RelativeSize
=
"700,200"
>
<
telerik:RadPaneGroup
x:Name
=
"mainDataPaneGroup"
>
<
telerik:RadPane
CanUserClose
=
"False"
x:Name
=
"mainDataPane"
>
<
local:Summary
></
local:Summary
>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer>
In the code behind I have a reference to the RadPane and I assign the new UserControl to the content of the RadPane:
public
static
void
ReloadMainDataPane(UserControl control)
{
MainDataPane.Content = control;
}
The behavior is correct and the new user control is loaded into the RadPane, however it seems that the previous UserControl that was in there is never actually unloaded and certainly doesn't ever get free'd from memory (even calling GC.Collect).
Is there something I have to do to unload the previous Pane from the RadPaneGroup? I'm not sure what the correct pattern is here to make sure the previous UserControl is properly unloaded from memory...
Thanks!
Chris