private void MaybeSplitForParagraph()
{
if (_textLengthInCurrent > 1000)
{
if (ResultGroup == null)
{
ResultGroup = new StackPanel { Orientation = Orientation.Vertical};
ResultGroup.Children.Add(Result);
Result.Margin = new Thickness(-6);
}
ResultGroup.Children.Add(Result = new RichTextBox { TextWrapping = TextWrapping.Wrap, Margin = new Thickness(-6, 6, 4, 6) });
_textLengthInCurrent = 0;
}
if (_currentParagraph != null)
{
_currentParagraph.Inlines.Add(new System.Windows.Documents.LineBreak());
}
_currentParagraph = new System.Windows.Documents.Paragraph { TextAlignment = TextAlignment.Left };
Result.Blocks.Add(_currentParagraph);
}