Below are the available properties complete with descriptions.
Property Name
Type
Description
ElementCursor
Rectangle
Cursor template.
DataClipboard
String
Gets or sets the clipboard data used when copying/pasting.
PainterClipboard
String
Gets or sets the style used by the style painter.
SelectionInProgress
Boolean
Gets a value indicating whether selection is in progress.
LastMousePosition
Point
Gets or sets the last mouse cursor position.
IsReady
Boolean
Gets or sets whether the content is fully loaded and ready for editing.
ExternalDragStart
Boolean
Gets or sets whether the RichTextBlock should pay special attention to a mouse up event.
DisabledOpacity
Double
Gets or sets the opacity for certain control elements when disabled.
EnableContextMenu
Boolean
Gets or sets whether the right-mouse click displays the context menu.
ID
String
Gets or sets the unique ID.
RichTextURL
String
Gets or sets a URL to load RichText from.
XAML
String
Gets the content as XAML.
ContentSelectionStart
Int32
Gets the index of the selection start.
ContentSelectionLength
Int32
Gets the length of the selected content.
ContentLength
Int32
Gets the length of the content.
SelectionStyles
List`1
Gets or sets the selected content styles.
SelectionStyle
RichTextBoxStyle
Gets the style of the selected content.
SelectionMetadatas
List`1
Gets or sets the selected content metadata.
SelectionMetadata
ContentMetadata
Gets the style of the selected content.
SelectionListType
Bullet
Gets the list type of the selected content.
SelectionAlignment
HorizontalAlignment
Gets the alignment of the selected content.
SelectionVerticalAlignment
VerticalAlignment
Gets the vertical alignment of the selected content.
ActiveTable
Table
Gets or sets the currently active table.
UndoHistory
Int32
Gets or sets the number of operations that can be undone.
History
History
Gets the undo history.
EnableQuickSelection
Boolean
Gets or sets whether selection mouse shortcuts such as double-clicking to select a word is enabled.
ErrorWordBrush
Brush
Gets or sets the brush to use when underlining miss-spelt words.
IsSpellChecking
Boolean
Gets whether the initial spell checking is in progress.
SpellChecksPerCycle
Int32
Gets or sets the number of words to check at a time during the initial spell check.
IsRightToLeft
Boolean
Gets or sets whether text input should slow from right-to-left.
EnableURLRecognition
Boolean
Gets or sets whether typed URLs are automatically formatted.
EnablePatternRecognition
Boolean
Gets or sets whether text pattern recognition is enabled.
TextPatterns
List`1
Gets or sets text patterns to look for.
BaseURL
String
Gets or sets the base URL used when importing/exporting to HTML.
URLPrefix
String
Gets or sets the prefix to be applied to all images/URLs.
LinkStyle
RichTextBoxStyle
Gets or sets the style used for links.
LineNumber
Int32
Gets the current line number where the cursor is positioned.
NumberOfLines
Int32
Gets the total number of lines in the document.
CustomNamespaces
List`1
Gets or sets any namespaces used by custom UIElements.
EnableSpellCheck
Boolean
Gets or sets whether spell checking related events are raised.
SelectedText
String
Gets the current selection as plain text.
CreateDefaultStyles
Boolean
Gets or sets whether the default H1,H2,H3 and Normal styles are created when content is loaded.
IsHistoryEnabled
Boolean
Gets or sets whether undo/redo is enabled.
EnableObjectSelection
Boolean
Gets or sets whether objects such as images canbe selected by clicking them.
EnableGlobalLinkStyle
Boolean
Gets or sets whether links should use a global style.
EnablePastingExternalStyles
Boolean
Gets or sets whether content styles from a source other than this RichTextBlock instance are used in a paste operation.
Below are the available methods, complete with parameters and descriptions.
Method Name
Description
Parameters
IsLinkMetadata(ContentMetadata)
Determines whether a metadata object contains link data.
Parameters
metadata
ContentMetadata object
Returns: True if it is a Link
GetStylesFromCSS(String)
Converts a block of CSS styles to RichText styles.
Load(String)
Loads RichText from the provided URL.
Parameters
url
URL of a valid RichText XML file
InsertText(String)
Inserts the string at the cursor.
InsertNewline()
Inserts a newline at the cursor position.
Insert(String)
Inserts a block of rich text at the cursor.
Parameters
Returns: Number of content elements created
Insert(String, ContentMetadata)
Inserts a block of rich text at the cursor with metadata.
Parameters
metadata
Metadata to be associated with the content
Returns: Number of content elements created
InsertTable(Int32, Int32, Int32, Int32, String)
Inserts the provided table object at the cursor position.
Parameters
headerRows
Number of header rows
headerColumns
Number of header columns
styleID
The table style ID
InsertTableRow(Boolean)
Inserts a before at the currently selected cell row.
Parameters
insertAfter
Specifying true here, the row will be inserted after the selected row
InsertTableColumn(Boolean)
Inserts a column before the currently selected cell column.
Parameters
insertAfter
Specifying true here, the column will be inserted after the selected column
DeleteTableRow()
Deletes the currently selected row.
DeleteTableColumn()
Deletes the currently selected column.
Delete(Boolean)
Deletes the selected text or the character before or after as indicated by the parameter.
Parameters
deleteForward
True to delete the character infront of the cursor
ApplyFormatting(Formatting, Object)
Applys formatting to the selected content.
Parameters
formatting
Formatting commang
param
Optional formatting parameters
ShowCursor()
Shows the cursor.
HideCursor()
Hides the cursor.
CursorLeft()
Moves the cursor left.
CursorRight()
Moves the cursor right.
CursorUp()
Moves the cursor Up.
CursorDown()
Moves the cursor Down.
Top()
Moves the cursor to the top of the document.
Home()
Moves the cursor to the top of the document.
End()
Moves the cursor to the end of the document.
Bottom()
Moves the cursor to the bottom of the document.
Clear()
Clears all content from the RichTextBox.
Select(Int32, Int32)
Selects the content for the provided range.
Parameters
length
Content length to select
SelectLine()
Selects the content of the current line.
SelectAll()
Selects all the content.
ClearSelection()
Clears the cursor selection.
Cut()
Cuts the selected content and places it on the internal clipboard.
Copy()
Copies the selected content to the internal clipboard.
Paste()
Pastes the content from the internal clipboard to the cursor position.
Painter()
Copies the current style to the clipboard and pastes it to the next selection.
Undo()
Un-does the last operation.
Redo()
Re-does the last operation.
Find(String)
Searches through the text content for the provided terms and moves the cursor to a match.
Parameters
Returns: True if a match was found
Goto(Int32)
Positions the cursor on the provided line.
ReturnFocus()
Applies focus to the control.
ShowSuggestions(IEnumerable<String>, RichTextBoxEventArgs)
Displays a popup with spelling suggestions.
Parameters
suggestions
String list of suggestions
e
RichTextBoxEventArgs object that generated the event
GetCursorCoordinates()
Retrieves the screen coordinates of the cursor.
Parameters
Returns: Position of the cursor
Save(Format, RichTextSaveOptions)
Saves the content as the specified format.
Load(Format, String)
Loads the Rich TextBox with content.
Parameters
format
Format of the provided content
RefreshStyles()
Re-applies styles to the content, this should be called if any modifications are made
to the Styles or TableStyles collections outside of the RichTextBlock/RichTextBox.
SimulateLeftClick(Point)
Simulates a left mouse click.
Parameters
position
The pixel position within the content area
ReplaceMisspeltWord(String)
Replaces the currently selected spelling mistake with a new word.
AddMisspeltWord()
Adds the currently selected spelling as a new word and clears any further hilighting of the word.
GetSelectedObjects()
Gets a collection of selected objects.
Parameters
Returns: Collection of selected objects
GetCursorElement()
Gets the cursor UIElement.
Parameters
Returns: Cursor UIElement
GetContentIndexAtPosition(Point)
Gets the index of content at the provided pixel position.
GetContentAtIndex(Int32, Int32, Format, RichTextSaveOptions)
Gets the content at a provided index.
Parameters
startIndex
Content start index
Returns: Plain text content
JoinSimilarElements()
Joins text elements with the same style and metadata properties.
RemoveUnusedStyles()
Removes all unused styles.
RefreshElement(UIElement)
Refreshes the layout for a given element.
Parameters
element
The RichTextBox element
InsertTableRow(Boolean, Boolean)
Inserts a before at the currently selected cell row.
Parameters
insertAfter
Specifying true here, the row will be inserted after the selected row
updateHistory
Indicates whether to update the undo history
InsertTableColumn(Boolean, Boolean)
Inserts a column before the currently selected cell column.
Parameters
insertAfter
Specifying true here, the column will be inserted after the selected column
updateHistory
Indicates whether to update the undo history
DeleteTableRow(Boolean)
Deletes the currently selected row.
Parameters
updateHistory
Indicates whether to update the undo history
DeleteTableColumn(Boolean)
Deletes the currently selected column.
Home(Boolean, Boolean)
Moves the cursor to the top/left of the document.
End(Boolean, Boolean)
Moves the cursor to the end of the document.
OnApplyTemplate()
This is called when the template has been bound to the control.