Events
This topic covers the specific events exposed by the RadImageEditor and RadImageEditorUI controls.
RadImageEditor Events
The ImageEditor raises the following events:
-
CommandError—Occurs when an error gets thrown while executing a command. Through theCommandErrorEventArgs, you can access the following property:Exception—Gets the currently thrown exception.
-
CommandExecuted—Occurs when a command gets executed. Through theImageCommandExecutedEventArgs, you can access the following properties:Command—Gets the current executed command.CommandParameter—Gets the current executed command parameter.
-
CommandExecuting—Occurs before a command gets executed. Through theImageCommandExecutingEventArgs, you can access the following properties:Command—Gets the current executed command.CommandParameter—Gets the current executed command parameter.
-
ImageViewSizeChanged—Occurs when theImageViewSizeproperty changes.ImageViewSizeproperty of RadImageEditor holds the actual image size (with scaling) set to the control. -
IsReadOnlyChanged—Occurs when theIsReadOnlyproperty changes. -
ScaleFactorChanged—Occurs when theScaleFactorvalue has changed. -
ToolCommitted—Occurs when a tool is committed. Through theToolCommittedEventArgs, you can access the following properties:Tool—Gets the current executed tool.ExecuteSameToolAfterCommit—Gets or sets a value indicating whether the tool is preserved as a current executing tool. If set to false, the current executing tool will be deactivated.
-
ToolCommitting—Occurs before a tool is committed. Through theToolCommittingEventArgs, you can access the following property:Tool—Gets the current executed tool.
When a tool is executed, the
CommandExecuting/CommandExecutedevents are raised for theExecuteToolCommand. The specific tool is available from theCommandParameter, however you cannot control its behavior (for example, cancel it). For this purpose theToolCommitting/ToolCommittedevents are raised. Find a working example of their usage in our online SDK reporitory: Handle Tool Commit.
RadImageEditorUI Events
The RadImageEditorUI component exposes the ImageEditorLoaded event, that occurs when the underlying RadImageEditor control is loaded. The image editor can be accessed using the ImageEditor property of RadImageEditorUI.
ImageEditorLoaded event handler
private void RadImageEditorUI_ImageEditorLoaded(object? sender, EventArgs e)
{
RadImageEditorUI ui = (RadImageEditorUI)sender;
RadImageEditor imageEditor = ui.ImageEditor;
}