Hi,
I have a question for the problem related radpane resources.
In my project, radpane contains content which has sometimes more than 300mb of RAM for each instance(composed of telerik controls, GroupView etc.), so I really need to dispose radpane resources.
I followed instructions after searching some references, and it said that I should call radpane.RemoveFromParent(); for it to be garbage collected.
However, it is not working. The resources still remains same after even afeter calling the method.
The problem arises when radpane content is user control with only managed resources, which to be collected by GC.
Here is my code.
<RadDock>
<RadPaneGroup>
new <radpane> is created each time..
</RadPaneGroup>
</RadDock>
When radpane is closed...
RadDock.CloseEvent += RaiseRadpaneCloseEvent();
RaiseRadpaneCloseEvent(object sender, eventargs e)
{
// small codes to call radpane.....
// here is radPane code.
if (radPane != null)
{
radPane.RemoveFromParent();
radPane.Content = null;
radPane.Header = null;
radPane.DataContext = null;
radPane.IsActive = false;
radPane.IsEnabled = false;
radPane = null;
}
// this works fine. When the content is UserControl
// only some control is Idisposable, put only when unmanaged resources exist inside control .
MethodInfo method = this.userControl.GetType().GetMethod("Dispose");
if (method == null) return;
method.Invoke(this.userControl, null);
}
Hope to get an answer quickly. Thanks.