Latest News

  • Super Tower Defense Game
    Mar 10, 2010

    New to the games section is the new Super Tower Defense game. Defend your base from the ever advancing army of tanks, buggies...

  • New Rich Text Editor User Control
    Feb 19, 2010

    By popular request, here we present a re-usable User Control containing the Liquid RichTextBox along with the most common formatting functions included.

  • Silverlight 3 Controls V5.2.7 Released
    Feb 19, 2010

    This release includes several fixes for issues raised in the forum. The main improvement is to the RichTextBox which now provides access and methods to the document elements allowing...

  • Super Shoot Em Up Game
    Feb 04, 2010

    Added to the games section is the new Super Shoot 'Em Up game. Take control of a tank with your aim being to blow up your opposing tanks and collect all the powerups.

  • Silverlight 3 Controls V5.2.6 Released
    Feb 04, 2010

    This release includes some minor fixes for several forum posts. Please see the notes on the download page for full details on what has changed.

Handling XAML Objects

One of the more unusual features of the RichTextBox is the ability to use XAML objects in your RichTextBox, by XAML it can be any object derived from FrameworkObject.  In the example there is a standard CheckBox control along with a TextBox, both these controls can be copied around in the demo, however only the CheckBox retains it's IsChecked state, the Text property of the TextBox does not persist when pasting.

It's worth explaining here that when you paste RichText from control to control the RichText is generated from the actual visual XAML elements, i.e. the various TextBlock elements are serialized to RichText however only certain properties are maintained.  It is upto the developer to implement logic to maintain control state (such as IsChecked for the CheckBox and Text for the TextBox) for XAML elements.

Copying and Pasting content which contains a XAML object

In the above screenshot we have copied a selection of text containing a Checkbox which is checked and a TextBox containing text.  The pasted version is immediately below and as you can see the Checkbox is pasted in a checked state, however the TextBox has lost it's text content.

ElementWriteToXML Event

This event is fired when you try to read the RichText property or perform a copy command, each XAML element in the RichText generates this event allowing you to inspect the control as it exists in the RichTextBox and optionally append additional parameters to the RichText representation of the XAML element.

ElementReadFromXML Event

This event is raised when you set the RichText property or perform a paste command, each XAML element in the RichText generates this event allowing you to access the instantiated XAML element as it is in the RichTextBox.  Using this method you can set additional properties during a paste command allowing you to gracefully perform Copy/Paste commands in your RichTextBox whilst maintaining "ViewState" of your individual XAML controls.

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