This is multi-purpose function that:
- Retrieves the text from the editor into the Document.CurrentText * Checks to see if the previous CurrentText matches the retrieved text This is the current change dirty status and the value returned * Updates the Document.IsDirty flag based on CurrentText == OriginalText This is the dirty status since last Save/Load - set only, not returned
You can also pass in document markdown here to avoid retrieving it in the editor (one less async block!)
public bool IsDirty(bool previewIfDirty, string markdown)
true or false
Should default to false. If set forces a preview refresh, otherwise not
The markdown to render.
Note: Different than the Document.IsDirty property which returns the dirty status since last save - this returns whether the editor's text and the WPF object text has changed.
Mainly called from the editor to determine whether the preview needs to be refreshed as well as by WPF code that needs to explicitly refresh the document save dirty status.
See also:Class MarkdownEditorSimpleInterop
Comment or report problem with topic