Event - Richasy/Controls-MarkdownEditBox GitHub Wiki
MarkdownEditBox exposes some simple events:
ControlLoaded
The editor of the control is based on Vue. This event will be triggered after the entire Vue framework is loaded (ie the internal App
).
Neither the editing area nor the preview area is loaded at this time.
You can initialize the editor in the callback of this event and call the MyEditor.Initialize(...)
method.
EditorLoaded
After calling the Initialize
method, the editor will start to load. Internally, this is a process of creating monaco-editor.
After the creation is complete, the event will be triggered.
So you can use this event to determine whether the internal editor has been loaded. All subsequent operations on the editor must be performed after monaco-editor is loaded.
ExcuteSuccess / ExcuteFailed
The control provides some methods to modify the editor, such as SetThemeAsync
, ExecuteActionAsync
, etc. The execution of these commands usually succeeds, but they may also fail. Listening to the corresponding event helps you understand what is happening inside.
The event parameters will contain the command type and command parameters you executed.
ContentChanged
The event will be triggered when the content in the editor changes, but the initial text passed in the Initialize
method will not trigger the event.
It should be noted that this event is passed in through the WebView. Internally, this is an asynchronous event.
So please don't add too complicated or time-consuming code to the event callback, otherwise it will affect the performance of event triggering.
RequestSave
It will be triggered when the editor detects a save request. Generally speaking, the trigger method is the shortcut key Ctrl
+ S
.