I am trying to do this too without much luck. I can't even get the Db example posted in the other thread to work correctly.
I am complicating this a bit by wanting to have the RadRichTextBox in a control.
So if I have a UserControl called MyRichTextEditor that contains
a toolbar
RadRichTextBox
and a DependencyProperty named RichText, how can I have the RichText property be bound to the content of RadRichTextBox?
I want to be able to do
<my:MyRichTextEditor RichText="{Binding SomeValue, Mode=TwoWay}" />
and have that get bound into my RadRichTextBox. As it stands now, I can't get anything to show up in the RadRichTextBox at all, even a canned string. Is having it in a UserControl complicating things?
Why is the HtmlProvider defined in Resources?
My control is:
<
UserControl
x:Class
=
"Navigator.Views.Controls.NavRichTextBox"
xmlns:documentsHtml
=
"clr-namespace:Telerik.Windows.Documents.FormatProviders.Html;assembly=Telerik.Windows.Documents.FormatProviders.Html"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"400"
>
<
UserControl.Resources
>
<
documentsHtml:HtmlDataProvider
x:Key
=
"HtmlDataProvider"
RichTextBox
=
"{Binding ElementName=_richTextBox}"
Html
=
"hello there"
/>
</
UserControl.Resources
>
<
Border
BorderBrush
=
"Black"
BorderThickness
=
"1"
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
StackPanel
x:Name
=
"_formattingToolBar"
Grid.Row
=
"0"
Orientation
=
"Horizontal"
Background
=
"LightGray"
>
<
telerik:RadRibbonToggleButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding Path=Commands.ToggleBoldCommand, ElementName=_richTextBox}"
Size
=
"Small"
SmallImage
=
"/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/bold.png"
/>
<
telerik:RadRibbonToggleButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding Path=Commands.ToggleItalicCommand, ElementName=_richTextBox}"
Size
=
"Small"
SmallImage
=
"/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/italic.png"
/>
<
telerik:RadRibbonToggleButton
telerik:RadRichTextBoxRibbonUI.RichTextCommand
=
"{Binding Path=Commands.ToggleUnderlineCommand, ElementName=_richTextBox}"
Size
=
"Small"
SmallImage
=
"/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/underline.png"
/>
</
StackPanel
>
<
telerik:RadRichTextBox
x:Name
=
"_richTextBox"
Grid.Row
=
"1"
VerticalAlignment
=
"Stretch"
HorizontalAlignment
=
"Stretch"
>
</
telerik:RadRichTextBox
>
<
StackPanel
Grid.Row
=
"2"
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"Footer here"
/>
</
StackPanel
>
</
Grid
>
</
Border
>
</
UserControl
>