internal void Setup(Document doc = null) { // If doc is null, create one if (doc == null) { if (CurrentDocument != null) { doc = CurrentDocument; // Use the document we used last time } else { switch (ContentMode) { case ContentMode.FlowDocument: doc = MULTITUDE.Class.Home.Current.CreateDocument(DocumentType.MarkdownPlus, "Unnamed Document"); break; case ContentMode.TableOnly: doc = MULTITUDE.Class.Home.Current.CreateDocument(DocumentType.DataCollection, "Unnamed Table"); break; default: break; } } } // Update UI Document = doc; CurrentDocument = doc; NotifyPropertyChanged("DocumentName"); // Update UI for Table Collection if (CurrentDocument is DataCollection) { UseTableUI(); } // Update Editor MarkdownRichTextEditor.Update(doc, false, ContentMode); MarkdownRichTextEditor.Focus(); }
private void Window_Closed(object sender, EventArgs e) { MarkdownRichTextEditor.Close(); CommitFlowDocumentContent(); (Owner as VirtualWorkspaceWindow).RestoreCanvasSpace(); }