private static void CreateESQuestion(ESQuestion question, int index, FlowDocument flowDocument, bool showAnswer, bool showResponse, ESQuestionResponse response) { System.Windows.Documents.Section questionSection = new System.Windows.Documents.Section(); flowDocument.Blocks.Add(questionSection); System.Windows.Documents.Section questionContentBlock = CreateContentControl(question.Content, (index + 1).ToString() + ". ", null, showResponse ? response : null); Paragraph lastParagraph = null; if (questionContentBlock.Blocks.LastBlock is Paragraph) { lastParagraph = questionContentBlock.Blocks.LastBlock as Paragraph; } if (lastParagraph == null) { lastParagraph = new Paragraph(); questionContentBlock.Blocks.Add(lastParagraph); } lastParagraph.Inlines.AddRange(new LineBreak[] { new LineBreak(), new LineBreak(), new LineBreak() }); if (showAnswer) { } questionSection.Blocks.Add(questionContentBlock); }
public ESQuestionUserControl(ESQuestion esQuestion, ESQuestionResponse response, int index) { this.esQuestion = esQuestion; this.index = index; this.response = response; InitializeComponent(); }