If I am using this:
public sealed class Document
{
public Document(string header, string content)
{
Heading = header;
Content = content;
}
public string Heading { get; set; }
public string Content { get; set; }
}
And this collection
public List<
Document
> Documents { get; }
And this document Implementation
public void Create(RadFlowDocument document)
{
var editor = new RadFlowDocumentEditor(document);
foreach (var t in Documents)
{
if (t.Content == null || t.Heading == null) continue;
var section = document.Sections.AddSection();
section.SectionType = SectionType.Continuous;
var paragraph = section.Blocks.AddParagraph();
editor.MoveToParagraphStart(paragraph);
paragraph.StyleId = BuiltInStyleNames.GetHeadingStyleIdByIndex(1);
paragraph.Inlines.AddRun(t.Heading).Paragraph.Inlines.AddRun();
//is it this next line, because I am making a new paragraph?
section.Blocks.AddParagraph().Inlines.AddRun(t.Content);
}
}
Everything generates great, but if I am in Word, and collapse one of t.Heading... The t.Content does not collapse under it. How can I add t.Heading that uses the default word style of 1 (Heading 1) and the text under it use Normal and expand and collapse with the Heading?