Latest News

  • Silverlight Online Chat
    Jul 24, 2010

    Today we launch the new Silverlight Live Chat application demonstrating the Liquid RichTextBox and Emoticon replacements.

  • New Super Shoot Em Up 2 Game
    Jun 29, 2010

    Added to the Games section is the new Super Shoot 'Em Up 2 game. Take control of your tank with the aim to defeat the computer controlled opponents. Features all new weapons, levels and Battle Mode!

  • Silverlight 4 Controls V5.3.2 Released
    Jun 28, 2010

    This release contains several fixes raised in the forums.

  • New Sandmania Puzzle Game
    Jun 18, 2010

    Sandmania is the latest game from vectorlight, the aim of this game is to guide sand from the top of the screen to the various colored containers below.

  • New Moon Tower Defense Game
    May 29, 2010

    Added to the Games section is the new Moon Tower Defense game. Defend the Moon from the circling Aliens and Humans.

Silverlight Rich TextBox

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

Properties for Liquid.RichTextBox

Below are the available properties complete with descriptions.

Property NameTypeDescription
AutoWrap Boolean Gets or sets whether text will wrap automatically with the width of the control or not.
WrapWidth Double Gets or sets the text wrapping width.
Zoom Double Gets or sets the zoom level.

 

Methods for Liquid.RichTextBox

Below are the available methods, complete with parameters and descriptions.

Method NameDescriptionParameters
GetCursorCoordinates() Retrieves the screen coordinates of the cursor.

Parameters

Returns: Position of the cursor

 

GetContentIndexAtPosition(Point) Gets the index of content at the provided pixel position.

Parameters

position
Pixel position
Returns: Content index

 

OnApplyTemplate() This is called when the template has been bound to the control.

The Rich TextBox inherits from Rich TextBlock.

Properties for Liquid.RichTextBlock

Below are the available properties complete with descriptions.

Property NameTypeDescription
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 NameDescriptionParameters
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.

Rate this page: 

1 Star 2 Star 3 Star 4 Star 5 Star
14 Ratings / 3.1 Average

Ultimate Gamers

  • 1 stig
  • 2 Gh0sT
  • 3 dhoz
  • 4 janso
  • 5 gaaslin
  • 6 RadiateLogic
  • 7 dan
  • 8 Haroldo
  • 9 bigblue531
  • 10 oussama

  • See the full chart here!

Silverlight Controls

  • Rich TextBox

    Create and edit rich content with this slick and expandable Rich TextBox...

  • TreeView

    This easy to use TreeView comes with drag and drop, sorting, searching and much more...

  • Context Menu

    You too can have cool popup context menus in your Silverlight applications...

  • Resizable Dialog

    Draggable and resizable popup dialogs are what serious Silverlight developers need...

  • Spell Checker

    Real-time spell checking in Silverlight? We did it first here...