ParagraphSettings listParagraphSettings = new ParagraphSettings();
listParagraphSettings.Spacing = new ParagraphSpacingSettings()
{
AfterParagraph = new ParagraphVerticalSpacing(
new Extent(0, ExtentUnitType.LogicalPixels)),
BeforeParagraph = new ParagraphVerticalSpacing(
new Extent(0, ExtentUnitType.LogicalPixels)),
};
ListTemplate redListTemplate = new ListTemplate()
{
LevelDefinitions = new ListLevelDefinitionCollection()
{
new ListLevelDefinition()
{
Level = 0,
LevelText = "FORGET %1",
NumberFormat = NumberFormat.DecimalEnclosedFullstop,
NumberSuffix = NumberSuffix.Space,
NumberSettings = new CharacterSettings ()
{
Bold = true,
Color = new ColorInfo(Colors.Red)
},
ParagraphSettings = listParagraphSettings,
}
}
};
ListStyle redListStyle = new ListStyle()
{
Id = "MyRedListStyle",
Template = redListTemplate
};
this.xamRichTextEditor1.Document.RootNode.Styles.Add(redListStyle);
RichTextList redRichTextList = new RichTextList()
{
Id = "MyRedRichTextList",
ListStyleId = "MyRedListStyle"
};
this.xamRichTextEditor1.Document.RootNode.Lists.Add(redRichTextList);