I'm getting a null reference exception when closing one of the pane and could not figure out why it is null in the RemovePane(RadPane pane) method.
We have override to that method,
protected override void RemovePane(RadPane pane)
{
if(pane.Header.ToString().ToLower()=="digital" || pane.Header.ToString().ToLower() == "analog")
SaveDebugPaneLayout(pane);
pane.DataContext = null;
pane.Content = null;
pane.ClearValue(RadDocking.SerializationTagProperty);
pane.RemoveFromParent();
}
And also the CreatePaneForItem method,
protected override RadPane CreatePaneForItem(object item)
{
var viewModel = item as DebugPaneViewModel;
if (viewModel != null)
{
var pane = viewModel.IsDocument ? new RadDocumentPane() : new RadPane();
pane.DataContext = item;
if (viewModel.ContentType != null)
{
if (viewModel.GetType().ToString().EndsWith("EditorViewModel"))
{
if (pane.Content == null)
{
dynamic obj = Activator.CreateInstance(viewModel.ContentType);
pane.Content = obj;
obj.DataContext = viewModel;
}
}
else
{
pane.Content = Activator.CreateInstance(viewModel.ContentType);
}
}
RadDocking.SetSerializationTag(pane, viewModel.ID);
return pane;
}
return base.CreatePaneForItem(item);
}
Is there a possibility to share a sample project that reproduces the null reference exception or a bit more information so that I can reproduce it on my side? Also, what is the version of the assemblies that are used on your side?