Silverlight Rich TextBlock Reference

The Rich TextBlock exposes several properties for controlling various aspects of the Rich TextBlock and its behaviour.

Properties for Liquid.RichTextBlock

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.

 

Methods for Liquid.RichTextBlock

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.

Parameters

styles
CSS styles
Returns: 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.

Parameters

text
Text to insert

 

InsertNewline()
Inserts a newline at the cursor position.
Insert(String)
Inserts a block of rich text at the cursor.

Parameters

richText
Rich Text xml
Returns: Number of content elements created

 

Insert(String, ContentMetadata)
Inserts a block of rich text at the cursor with metadata.

Parameters

richText
Rich Text xml
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

rows
Number of rows
columns
Number of columns
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

startIndex
Start index
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

terms
Terms to search for
Returns: True if a match was found

 

Goto(Int32)
Positions the cursor on the provided line.

Parameters

lineNumber
Line number

 

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.

Parameters

format
The output format
options
Save options
Returns: Rich text

 

Load(Format, String)
Loads the Rich TextBox with content.

Parameters

format
Format of the provided content
content
Content to load

 

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.

Parameters

newWord
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.

Parameters

position
Pixel position
Returns: Content index

 

GetContentAtIndex(Int32, Int32, Format, RichTextSaveOptions)
Gets the content at a provided index.

Parameters

startIndex
Content start index
length
Content length
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.
 
 
Latest Games
Zombie Escape
Apr 19, 2016
Plays: 2,770

Zombie Escape ScreenshotDrive fast before the crazy mutant zombies get you!

6 Ratings/4.1 Average
Car Parking
Jan 16, 2016
Plays: 2,625

Car Parking ScreenshotGuide the car to its parking space in this fun Car Parking game.

1 Rating/5 Average
Trash It
Jan 11, 2016
Plays: 2,478

Trash It ScreenshotAim for the Trash Can and get the various items of Trash in the bin.

4 Ratings/5 Average
Sky Fly
Jan 11, 2016
Plays: 2,692

Sky Fly ScreenshotFly your plane in this colorful vertical scrolling shoot-em-up. Blast the bad guys and collect any bonus's they leave behind.

1 Rating/5 Average
Professor Snappy
Jan 11, 2016
Plays: 2,156

Professor Snappy ScreenshotPop as many bubbles as possible in this fun and colorful bubble popping game. The levels start off easy enough but gradually get harder!

1 Rating/5 Average
Monster Match Saga
Jan 10, 2016
Plays: 2,479

Monster Match Saga ScreenshotHere we have a bunch of monsters that need to be matched up. Look out for the bomb and spinning monsters that will cause special damage!

3 Ratings/4.6 Average
Fly Bird Fly
Jan 10, 2016
Plays: 2,304

Fly Bird Fly ScreenshotGuide your friendly Bird through the maze of pipes and other obstacles collecting the Stars in this cool arcade game inspired by the legendary Flappy Bird.

1 Rating/5 Average
Life In One
Jan 10, 2016
Plays: 2,480

Life In One ScreenshotYou are stranded on an Alien planet. Your goal is to build a space rocket and escape. Start by building units to create power and mine the metal patches. Build defenses to defend your base from the advancing Aliens and Zombies!

2 Ratings/3 Average
X Pool
Jan 02, 2016
Plays: 3,122

X Pool ScreenshotPlay Pool against the computer or battle against your friends in the online mode!

3 Ratings/3 Average
Fruit Slicer
Jan 02, 2016
Plays: 2,195

Fruit Slicer ScreenshotSlice the fruit that is thrown up onto the screen. Slice the fruit into multiple pieces for maximum points!

1 Rating/5 Average