I have multiple FlowDocuments that I would like to concatenate together. The method below doesn't have a return statement. What I would like to do is to turn the TextRange back into a FlowDocument.
private FlowDocument Concatenate(FlowDocument source, FlowDocument target)
{ using(MemoryStream ms = new MemoryStream())
{
TextRange tr = new TextRange(source.ContentStart, source.ContentEnd);
tr.Save(ms, DataFormats.XamlPackage);
ms.Seek(0, SeekOrigin.Begin);
tr = new TextRange(target.ContentEnd, target.ContentEnd);
tr.Load(ms, DataFormats.XamlPackage);
}
}