MainWindow Class

Interaction logic for MainWindow.xaml

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Media.Visual
            System.Windows.UIElement
               System.Windows.FrameworkElement
                  System.Windows.Controls.Control
                     System.Windows.Controls.ContentControl
                        System.Windows.Window
                           MahApps.Metro.Controls.MetroWindow
                              MarkdownMonster.MainWindow

Class Members

MemberDescription
Constructor
_CreateDelegate
public Delegate _CreateDelegate(Type delegateType, string handler)
ActivateTab Activates a tab by checking from a filename and activating or optionally open the a new tab.
public Task ActivateTab(TabItem tab, bool setFocus)
AddEditToolbarIcon Adds an image icon to the editor toolbar
public void AddEditToolbarIcon(string iconName, string markdownActionCommand, ToolBar toolbar, ICommand command)
AddRecentFile
public void AddRecentFile(string file, bool noConfigWrite)
AddRightSidebarPanelTabItem Adds a new panel to the right sidebar
public void AddRightSidebarPanelTabItem(TabItem tabItem, string tabHeaderText, ImageSource tabHeaderIcon, bool selectItem, bool insertAtTop)
BindTabHeaders Binds all Tab Headers
public void BindTabHeaders()
Button_Handler Generic button handler that handles a number of simple tasks in a single method to minimize class noise.
public void Button_Handler(object sender, RoutedEventArgs e)
CloseAllTabs
public Task CloseAllTabs(TabItem allExcept)
CloseTab Closes a tab and ask for confirmation if the tab doc is dirty.
public Task CloseTab(TabItem tab, bool rebindTabHeaders, bool dontPromptForSave)
GenerateContextMenuItemsFromOpenTabs
public List GenerateContextMenuItemsFromOpenTabs(ContextMenu ctx)
GetActiveMarkdownEditor
public MarkdownDocumentEditor GetActiveMarkdownEditor()
GetDragablzItemFromTabItem Returns a DragablzItem from a TabItem
public DragablzItem GetDragablzItemFromTabItem(TabItem tab)
GetDragablzItems Returns a list of DragablzItems
public List GetDragablzItems()
GetTabFromFilename Retrieves an open tab based on its filename.
public TabItem GetTabFromFilename(string filename)
GetTabItemFromDragablz Returns a TabItem from a Dragablz (Content - convenience method)
public TabItem GetTabItemFromDragablz(DragablzItem dgz)
InitializeComponent InitializeComponent
public void InitializeComponent()
LoadPreviewBrowser Create an instance of the Preview Browser either using the default IE based preview browser, or if an addin has registered a custom preview browser.
public void LoadPreviewBrowser()
Navigate Navigates the PreviewBrowser to a specific URL
public void Navigate(string url)
NextTab
public Task NextTab()
OnActivated
public void OnActivated(object sender, EventArgs e)
OnAddinsLoaded This is called only if addin loading takes very long Potentially fired off
public Task OnAddinsLoaded()
OnClosing
public void OnClosing(CancelEventArgs e)
OnContentRendered
public void OnContentRendered(EventArgs e)
OnDeactivated
public void OnDeactivated(EventArgs e)
OpenBrowserTab Opens a preview tab
public Task OpenBrowserTab(string url, bool selectTab, bool isImageFile, ImageSource icon, string tabHeaderText)
OpenFile High level wrapper around OpenTab() that checks for different file types like images and projects that have non-tab behavior. Use this function for generically opening files by filename .
public Task OpenFile(string filename, MarkdownDocumentEditor editor, bool showPreviewIfActive, string syntax, bool selectTab, bool rebindTabHeaders, bool batchOpen, int initialLineNumber, bool readOnly, bool noFocus, bool isPreview, bool noShellNavigation)
OpenTab Opens a tab by a filename
public Task OpenTab(string mdFile, MarkdownDocumentEditor editor, bool showPreviewIfActive, string syntax, bool selectTab, bool rebindTabHeaders, bool batchOpen, int initialLineNumber, bool readOnly, bool noFocus, bool isPreview)
PreviewMarkdown Refreshes the Preview Browser. Although this method is synchronous, the refresh occurs asynchronously using Fire and Forget
public void PreviewMarkdown(MarkdownDocumentEditor editor, bool keepScrollPosition, bool showInBrowser, string renderedHtml, int editorLineNumber)
PreviewMarkdownAsync Refreshes the preview browser. This method can be awaited to wait for completion or ignore the task result to let it run in the background. You can choose to not await this result but if you do use…
public Task PreviewMarkdownAsync(MarkdownDocumentEditor editor, bool keepScrollPosition, bool showInBrowser, string renderedHtml, int editorLineNumber)
PreviousTab
public Task PreviousTab()
RefreshTabFromFile Refreshes an already loaded tab with contents of a new (or the same file) file by just replacing the document's text. If the tab is not found a new tab is opened. Note: File must already be open for…
public Task RefreshTabFromFile(string editorFile, bool maintainScrollPosition, bool noPreview, bool noSelectTab, bool noFocus, bool readOnly, bool isPreview, TabItem existingTab)
RemoveRightSideBarPanelTabItem Removes a right side bar panel by tab item
public bool RemoveRightSideBarPanelTabItem(TabItem tabItem)
RestoreWindowSettings
public void RestoreWindowSettings()
SaveAsFile Save As File prompts for a new filename to save the file as.
public Task SaveAsFile(bool secureSave)
SaveFile Saves the file in the active editor.
public Task SaveFile(bool secureSave, bool promptForSaveIfDirty)
SaveSettings Save active settings of the UI that are persisted in the configuration
public Task SaveSettings()
SetEditorFocus Helper method that sets editor focus
public void SetEditorFocus()
SetStatusIcon Resets the Status bar icon on the left to its default green circle
public void SetStatusIcon(EFontAwesomeIcon icon, Color color, bool spin)
SetTabHeaderBinding Binds the tab header to our custom controls/container that shows a customized tab header
public void SetTabHeaderBinding(TabItem tab, MarkdownDocument document, string propertyPath, ImageSource icon, string explicitTitle)
SetWindowTitle Sets the Window Title followed by Markdown Monster (registration status) by default the filename is used and it's updated whenever tabs are changed. Note: ActiveTab change causes the title to be…
public void SetWindowTitle(string title)
ShowFolderBrowser Shows or hides the File Browser
public void ShowFolderBrowser(bool hide, string folder, bool setFocus)
ShowLeftSidebar
public void ShowLeftSidebar(bool hide)
ShowMessageOverlayAsync Helper routine to show a Metro Dialog. Note this dialog popup is fully async!
public Task ShowMessageOverlayAsync(string title, string message, MessageDialogStyle style, MetroDialogSettings settings)
ShowPreviewBrowser Shows or hides the preview browser
public void ShowPreviewBrowser(bool hide, bool refresh)
ShowRightSidebar
public void ShowRightSidebar(bool hide)
ShowStatus
public void ShowStatus(string message, int milliSeconds, EFontAwesomeIcon icon, Color color, bool spin, bool flashIcon)
ShowStatusError Displays an error message using common defaults for a timeout milliseconds
public void ShowStatusError(string message, int timeout, EFontAwesomeIcon icon, Color color, bool flashIcon)
ShowStatusProgress Displays an Progress message using common defaults including a spinning icon
public void ShowStatusProgress(string message, int timeout, EFontAwesomeIcon icon, Color color, bool spin)
ShowStatusSuccess Shows a success message with a green check icon for the timeout
public void ShowStatusSuccess(string message, int timeout, EFontAwesomeIcon icon, Color color, bool flashIcon)
SyncFolderBrowser Syncs the fileOrFolder browser to the active document
public void SyncFolderBrowser()
TabControl_SelectionChanged Handles various tasks around tab changes: Update Preview Window Title Update Active Flag checking Update Document Outline IMPORTANT: Additional change handling in AppModel.ActiveEditorTabItem used…
public void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
TabToolTip Displays a tool tip on a tab
public void TabToolTip(DragablzItem dgz)
UpdateDocumentOutline
public void UpdateDocumentOutline(int editorLineNumber)
UpdateLinkChecker
public void UpdateLinkChecker()
Namespace: MarkdownMonster

Assembly: MarkdownMonster.dll