Events
The .NET MAUI RichTextEditor emits a set of events that allow you to configure the component's behavior in response to specific user actions.
The RichTextEditor component exposes the following events:
-
OpenHyperlinkError—Raised when users try to open invalid URLs in the editor. TheOpenHyperlinkErrorevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; OpenHyperlinkErrorEventArgs, which provides the following properties:Error—of typeSystem.Exception; can be used to get the exact error message;Url—of type string; defines the URL of the hyperlink;Handled—a boolean property indicating whether the event is handled.
- The
-
IsReadOnlyChanged—Raised when read-only mode of the RichTextEditor is switched. TheIsReadOnlyChangedevent receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<bool>—provides theNewValueandOldValueproperties of typebool, indicating theIsReadOnlyproperty change.
- The
-
FontFamilyChanged—Raised when theFontFamilyproperty of the RichTextEditor is modified. TheFontFamilyChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<string>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
FontSizeChanged—Raised when theFontSizeproperty of the RichTextEditor is modified. TheFontSizeChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<RichTextUnit>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
FontAttributesChanged—Raised when theFontAttributes, such as bold, italic, subscript and superscript is modified. TheFontAttributesChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<RichTextFontAttributes>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
TextDecorationsChanged—Raised when theTextDecorations, such as underline and strike through is modified. TheTextDecorationsChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<RichTextDecorations>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
TextFormattingChanged—Raised when theTextFormatting, such as such as heading, paragraph or quotation is modified. TheTextFormattingChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<RichTextFormatting>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
HorizontalTextAlignmentChanged—Raised when theHorizontalTextAlignment, such as left, right, center or justify is modified. TheHorizontalTextAlignmentChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<RichTextHorizontalAlignment>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
ListTypeChanged—Raised when theListType, such as numbered or bulleted list is modified. TheListTypeChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<RichTextListType>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
TextColorChanged—Raised when theTextColorproperty of the RichTextEditor is updated. TheTextColorChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<Color>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
HighlightTextColorChanged—Raised when theHighlightTextColorproperty of the RichTextEditor is updated. TheHighlightTextColorChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<Color>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
SelectionRangeChanged—Raised when theSelectionRange, which defines the start and end position of the currently selected inside the editor text, is updated. TheSelectionRangeChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<RichTextSelectionRange>provides theNewValueandPreviousValueproperties of typeTValue.
- The
-
IsHyperlinkSelectedChanged—Raised when a hyperlink inside the editor is selected. TheIsHyperlinkSelectedChangedevent handler receives two parameters:- The
Sender, which is the RichTextEditor control; ValueChangedEventArgs<bool>provides theNewValueandPreviousValueproperties of typeTValue.
- The