EditorWebViewDotnetInterop.IsDirty

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)

Return Value

true or false

Parameters

previewIfDirty
Should default to false. If set forces a preview refresh, otherwise not

markdown
The markdown to render.

Remarks

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 EditorWebViewDotnetInterop

© West Wind Technologies, 2016-2023 • Updated: 11/23/21
Comment or report problem with topic