Silverlight Rich TextBlock
The Rich TextBlock control provides a read-only view of a Rich Text XML file generated by the Liquid Rich TextBox.
This Silverlight only Rich TextBlock Control is easy to implement on your Silverlight driven website and is also customizable to provide a visual feel suitable for any site design.
You need to login to Download the Roller Blind example, If you do not have a login you can register for free!
How to Use the Rich TextBlock Control
To use the Rich TextBlock on your Silverlight page:
<UserControl x:Class="RichTextBlock.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquid="clr-namespace:Liquid;assembly=Liquid"
Width="500" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<ScrollViewer>
<liquid:RichTextBlock WrapWidth="480" RichTextURL="RichText.xml" />
</ScrollViewer>
</Grid>
</UserControl>
In this example we load an XML file containing Rich Text, this is called RichText.xml and is specified in the RichTextURL property. It is important you have this file included in your project.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace RichTextBlock
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
}
}
}
Example Silverlight Rich TextBlock Control:
Your Comments and Questions Answered
You are not logged in. You need to login to post new messages, if you do not have a login you can register for free!