Extends the System.Windows.Control.RichTextBox control that represents a rich editing control which operates on FlowDocument objects.
The following example shows how to use a text formatter other than the default RtfFormatter. The Notes property to which Text is bound contains "This is the RichTextBox\r\n".
<xctk:RichTextBox x:Name="_richTextBox" Grid.Row="1" Margin="10" BorderBrush="Gray" Padding="10"
Text="{Binding Notes}"
ScrollViewer.VerticalScrollBarVisibility="Auto">
<xctk:RichTextBox.TextFormatter>
<xctk:PlainTextFormatter />
</xctk:RichTextBox.TextFormatter>
</xctk:RichTextBox>
The following example shows how to use an RTF text formatter. The Notes property to which Text is bound contains "{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs18\f2\cf0 \cf0\ql{\f2 {\ltrch This is the }{\b\ltrch RichTextBox}\li0\ri0\sa0\sb0\fi0\ql\par}}}".
<xctk:RichTextBox x:Name="_richTextBox" Grid.Row="1" Margin="10" BorderBrush="Gray" Padding="10"
Text="{Binding Notes}"
ScrollViewer.VerticalScrollBarVisibility="Auto">
<xctk:RichTextBox.TextFormatter>
<xctk:RtfFormatter />
</xctk:RichTextBox.TextFormatter>
</xctk:RichTextBox>
The following example shows how to use a text formatter other than the default RtfFormatter. The Notes property to which Text is bound contains XML.
<xctk:RichTextBox x:Name="_richTextBox" Grid.Row="1" Margin="10" BorderBrush="Gray" Padding="10"
Text="{Binding Notes}"
ScrollViewer.VerticalScrollBarVisibility="Auto">
<xctk:RichTextBox.TextFormatter>
<xctk:XamlFormatter />
</xctk:RichTextBox.TextFormatter>
</xctk:RichTextBox>
Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2