public void RemovePaneIfExists(ContentDocument pane) { if (tabbedDocumentContainer1.ContainsDocument(pane)) { tabbedDocumentContainer1.RemoveDocument(pane); } }