private void tabbedDocumentContainer1_ActiveDocumentChanging(ContentDocument newActiveDocument)
{
if (tabbedDocumentContainer1.ActiveDocument != null)
{
// Remember which pane and item were selected on the property grid,
// so that we can restore them later
tabbedDocumentContainer1.ActiveDocument.SelectedPropertyGridTab =
propertiesPanel.propertiesGrid.SelectedTab.TabName;
if (propertiesPanel.propertiesGrid.SelectedGridItem != null)
{
tabbedDocumentContainer1.ActiveDocument.SelectedPropertyGridItem =
propertiesPanel.propertiesGrid.SelectedGridItem.Label;
}
}
}