Migrating from Xamarin RichTextEditor to .NET MAUI RichTextEditor

9 Sep 20256 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 https://help.syncfusion.com/cr/maui/Syncfusion.Maui.RichTextEditor.html, 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 place holder font color.

PlaceHolderFontFamily

PlaceholderFontFamily Gets or sets the value for place holder font family.

PlaceHolderFontSize

PlaceholderFontSize Gets or sets the value for place holder font size.

WordWrap

EnableWordWrap Gets or sets the word-wrap that allows long words to be able to be broken 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 for custom actions to be performed.

Methods

Xamarin SfRichTextEditor .NET MAUI SfRichTextEditor Description

AlignFull()

AlignJustify() Justifies the paragraph.

ApplyFont(string fontName)

ApplyFontFamily(string fontName) JApplies 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.

InsertImage(ImageSource imageSource)

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

SetFontColor(string fontColor)

ApplyTextColor(Color textColor) Apply the text color.

SetFontSize(string fontSize)

ApplyFontSize(double fontSize) Apply the font size.

SetHighlightColor(string color)

ApplyHighlightColor(Color highlightColor) Highlights the background color.

SetParagraphFormat(string heading)

ApplyParagraphFormat(RichTextEditorParagraphFormat format) Apply the paragraph formatting style.

ToggleSubScript()

ToggleSubscript() Toggles the selected text as sub script format.

ToggleSuperScript()

ToggleSuperscript() Toggles the selected text as super script 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.