Migrating from Xamarin RichTextEditor to .NET MAUI RichTextEditor

20 Jul 20266 minutes to read

To migrate easily from Xamarin SfRichTextEditor to .NET MAUI SfRichTextEditor, we kept all the APIs from Xamarin SfRichTextEditor in MAUI SfRichTextEditor. However, to maintain the consistency of API naming in MAUI, we renamed some of the APIs. The APIs that have been changed in MAUI SfRichTextEditor from Xamarin SfRichTextEditor are detailed as follows.

Namespaces

Xamarin SfRichTextEditor .NET MAUI SfRichTextEditor
Syncfusion.RichTextEditor.XForms Syncfusion.Maui.RichTextEditor

Properties

Xamarin SfRichTextEditor .NET MAUI SfRichTextEditor Description

AutoSize

EnableAutoSize Gets or sets a value indicating whether the editor should automatically resize based on its content.

BackgroundColor

EditorBackgroundColor Gets or sets the background color of the editor's content area.

DefaultFont

DefaultFontFamily Gets or sets the default font family.

DefaultFontColor

DefaultTextColor Gets or sets the default text color.

PlaceHolder

Placeholder Gets or sets the placeholder text that is displayed when the editor is empty.

PlaceHolderFontColor

PlaceholderColor Gets or sets the value for placeholder font color.

PlaceHolderFontFamily

PlaceholderFontFamily Gets or sets the value for placeholder font family.

PlaceHolderFontSize

PlaceholderFontSize Gets or sets the value for placeholder font size.

WordWrap

EnableWordWrap Gets or sets whether long words break and wrap onto the next line.

Events

Xamarin SfRichTextEditor .NET MAUI SfRichTextEditor Description

ImageInserted

ImageRequested Occurs when an image is about to be inserted, allowing for customization of the image source.

HyperlinkSelected

HyperlinkClicked Occurs when a hyperlink is tapped, allowing custom actions.

Methods

Xamarin SfRichTextEditor .NET MAUI SfRichTextEditor Description

AlignFull()

AlignJustify() Justifies the paragraph.

ApplyFont(string fontName)

ApplyFontFamily(string fontName) Applies the specified font family.

EditHyperlink(string url, string text)

EditHyperlink(string text, string oldUrl, string newUrl) Edits the hyperlink.

InsertHyperlink(string url, string displayText)

InsertHyperlink(string displayText, string url) Inserts the hyperlink.

RemoveHyperlink()

RemoveHyperlink(string text, string url) Removes the hyperlink matching the specified text and URL.

InsertImage(ImageSource imageSource)

InsertImage(SfRichTextEditorImageSource imageSource) Inserts the specified image into the SfRichTextEditor.

SetFontColor(string fontColor)

ApplyTextColor(Color textColor) Applies the text color.

SetFontSize(string fontSize)

ApplyFontSize(double fontSize) Applies the font size.

SetHighlightColor(string color)

ApplyHighlightColor(Color highlightColor) Applies highlight color to the selected text.

SetParagraphFormat(string heading)

ApplyParagraphFormat(RichTextEditorParagraphFormat format) Applies the paragraph formatting style.

ToggleSubScript()

ToggleSubscript() Toggles the selected text as subscript format.

ToggleSuperScript()

ToggleSuperscript() Toggles the selected text as superscript format.

Limitations

  • Nested ScrollView: RichTextEditor scroll behavior is incompatible with parent ScrollView containers and will be automatically disabled.
  • AutoSize Configuration: To prevent off-screen rendering when AutoSize is enabled, configure the MaximumHeightRequest property to constrain the control within viewport boundaries.
  • Keyboard Interaction: Toolbar visibility is affected when MaximumHeightRequest extends into the on-screen keyboard area, causing automatic hiding.
  • Supported Content Types: Editor content is restricted to plain text and HTML markup formats only.