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. TheOpenHyperlinkError
event 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. TheIsReadOnlyChanged
event receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<bool>
—provides theNewValue
andOldValue
properties of typebool
, indicating theIsReadOnly
property change.
- The
-
FontFamilyChanged
—Raised when theFontFamily
property of the RichTextEditor is modified. TheFontFamilyChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<string>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
FontSizeChanged
—Raised when theFontSize
property of the RichTextEditor is modified. TheFontSizeChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<RichTextUnit>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
FontAttributesChanged
—Raised when theFontAttributes
, such as bold, italic, subscript and superscript is modified. TheFontAttributesChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<RichTextFontAttributes>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
TextDecorationsChanged
—Raised when theTextDecorations
, such as underline and strike through is modified. TheTextDecorationsChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<RichTextDecorations>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
TextFormattingChanged
—Raised when theTextFormatting
, such as such as heading, paragraph or quotation is modified. TheTextFormattingChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<RichTextFormatting>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
HorizontalTextAlignmentChanged
—Raised when theHorizontalTextAlignment
, such as left, right, center or justify is modified. TheHorizontalTextAlignmentChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<RichTextHorizontalAlignment>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
ListTypeChanged
—Raised when theListType
, such as numbered or bulleted list is modified. TheListTypeChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<RichTextListType>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
TextColorChanged
—Raised when theTextColor
property of the RichTextEditor is updated. TheTextColorChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<Color>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
HighlightTextColorChanged
—Raised when theHighlightTextColor
property of the RichTextEditor is updated. TheHighlightTextColorChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<Color>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
SelectionRangeChanged
—Raised when theSelectionRange
, which defines the start and end position of the currently selected inside the editor text, is updated. TheSelectionRangeChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<RichTextSelectionRange>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The
-
IsHyperlinkSelectedChanged
—Raised when a hyperlink inside the editor is selected. TheIsHyperlinkSelectedChanged
event handler receives two parameters:- The
Sender
, which is the RichTextEditor control; -
ValueChangedEventArgs<bool>
provides theNewValue
andPreviousValue
properties of typeTValue
.
- The