none
How to display single FlowDocument in multiple FlowDocumentReader/FlowDocumentPageViewer?

    General discussion

  • Hi friends,

    I want to display same FlowDocument in more than one FlowDocumentReader or FlowDocumentPageViewer. How should I do?
    It seems that one FlowDocument instance can have only one parent.

    Thank you!
    Tim
    • Changed type Marco Zhou Friday, December 12, 2008 8:45 AM OP doesn't revert back
    • Changed type Marco Zhou Friday, December 12, 2008 8:45 AM OP doesn't revert back
    • Changed type Marco Zhou Friday, December 12, 2008 8:45 AM OP doesn't revert back
    Saturday, December 06, 2008 9:00 AM

All replies

  • You could make a clone of the original FlowDocument, and have it displayed in the second FlowDocumentReader:

    FlowDocument doc = new FlowDocument();
    MemoryStream ms = new MemoryStream();
    new TextRange(doc.ContentStart, doc.ContentEnd).Save(ms, DataFormats.Xaml);
    ms.Flush();
    ms.Seek(0, SeekOrigin.Begin);
    FlowDocument cloneDoc = new FlowDocument();
    new TextRange(cloneDoc.ContentStart, cloneDoc.ContentEnd).Load(ms, DataFormats.Xaml);

    Thanks

    Another Paradigm Shift
    http://shevaspace.blogspot.com
    Monday, December 08, 2008 7:41 AM
  • We are changing the issue type to “Comment” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by clicking the "Options" link at the top of your post, and selecting "Change Type" menu item from the pop menu. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

     

    Thank you!


    Another Paradigm Shift
    http://shevaspace.blogspot.com
    Friday, December 12, 2008 8:45 AM