void DestroyOrphanedDocuments()
        {
            var orphans = LogicalLayoutSerializationHelper.GetOrphanedDocuments(this)
                          .Except(LogicalLayoutSerializationHelper.GetImmediateChildren(this));

            foreach (IDocument orphan in orphans)
            {
                orphan.DestroyOnClose = true;
                orphan.Close();
            }
        }
 public void SaveLogicalLayout()
 {
     ViewModelLogicalLayoutHelper.PersistentLogicalLayout = LogicalLayoutSerializationHelper.SerializeDocumentManagerService(this);
 }
 public static void SaveLayout()
 {
     LayoutSettings.Default.ViewsLayout = LogicalLayoutSerializationHelper.Serialize(PersistentViewsLayout);
     LayoutSettings.Default.Save();
 }