/// <summary> /// Displays the current <c>PreviewController</c>'s document in the webview /// </summary> /// <param name="title">The title of the document being displayed.</param> /// <param name="text">The formatted text to be displayed.</param> /// <param name="previewController">The <c>ViewController</c> who's document is being displayed.</param> public void DisplayPreview(string title, string text, ViewController previewController, string filePath) { string baseURL = ""; // Save connection to the currently displayed document PreviewController = previewController; // Move to top of view? if (title != LastWindowTitle) { // Jump to top of document ContentController.ScrollToTop(); } // Update the display Window.Title = string.Format("{0} Preview", title); if (filePath != "") { baseURL = Path.GetDirectoryName(filePath); } ContentController.DisplayPreview(text, baseURL); // Save title LastWindowTitle = title; }
/// <summary> /// Erases the preview and breaks the connection to the document. /// </summary> /// <param name="sender">The control calling this action.</param> partial void ErasePreview(Foundation.NSObject sender) { // Empty preview Window.Title = "No Preview"; ContentController.DisplayPreview("", ""); PreviewController = null; }