Hello,
I use richtextbox with XamlDataProvider, and I would like to change default font size (set it to 8) and line spacing (set it to 1) for bullets and numbered lists. It means, when the control is loaded and a user creates one of the lists, default font size and line spacing should be 8 and 1 (or other values I set in the code)
I could do such functionality for simple text, but couldn't for lists. In the attached file you can find described issue from a user point of view (if he or she started writing text without any settings changes)
Below you can also find my code.
Hope for your help.
Thanks.
XAML:
...
<
telerik:XamlDataProvider
x:Name
=
"XamlDataProvider"
Xaml
=
"{Binding ElementName=RichTextBoxControl, Path=Text, ode=TwoWay}"
RichTextBox
=
"{Binding ElementName=Editor}"
SetupDocument
=
"XamlDataProvider_OnSetupDocument"
/>
<
telerik:RadRichTextBox
Name
=
"Editor"
Grid.Row
=
"1"
PreviewMouseDoubleClick
=
"Editor_OnPreviewMouseDoubleClick"
IsSpellCheckingEnabled
=
"False"
DocumentInheritsDefaultStyleSettings
=
"True"
FontSize
=
"12"
/>
...
C#:
...
private
void
XamlDataProvider_OnSetupDocument(
object
sender, SetupDocumentEventArgs e)
{
e.Document.ParagraphDefaultSpacingAfter = 0;
e.Document.LineSpacingType = LineSpacingType.Auto;
e.Document.LineSpacing = 1;
}
...