flowdocument - Bookmarking WPF's FlowDocumentReader -


I am trying to save and restore the status of the document within the Flow Documentstrack to create the bookmark feature. There is no demand or search feature creation available to be publicly accessible, I am left with the following options:

  1. Instead of using the flow document page weaver Every time the window is saved, the shape is resized and it is reloaded as the app is reloaded.

  2. FlowDocumentReader's document loop through all the elements of the property, an on-screen hit test, then using the reflection to use the internal text features, after that text Is used to get back in time.

  3. Serial the entire control.

  4. Write your document viewer control. No 1 is disturbing because I have to confiscate the options of viewing two pages and scrolls of the Flow Document Reader. This also means that the user should search the saved page before getting the chance to resize the window. It is weak and probably will break if the user says, the resolution switched between the sessions.

    No 2 is a gaudy hack that will probably work, but will be slow and completely broken if the interior ever changes.

    No. 3 is looking like my best bet, but it only allows me to save / restore the current status, does not set arbitrary bookmarks.

    No 4 is too much work; These controls are completely , I just need one attribute ...

    Know about this Is there any other way? It works well for page views, but not for scroll view, which is fine

. P>

Reader type is the flow documentstrider , and there is flow document in the document.

Set the bookmark:

  var paginator = ((IDocumentPaginatorSource) document). DynamicDocumentPaginator as DocumentPaginator; Var status = Pageitator. GetPagePosition (paginator.GetPage (reader.PageNumber-1)) as TextPointer; Bookmark = Status. Paragraph;  

Restore the bookmark:

  bookmark.bringinetview ();  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -