none
about load very long text

    Question

  • Hi,

    I have a very long contract and need user to read.

    and I hope that user needs to read all (scroll to bottom) then can go next.

    I first tried to use scrolltextblock

    http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx

    It takes at least 5s to load contract. Then I tried webbrowser to load as html, it runs more faster.

    but the webbrowser doesn't have scroll event, how do I know user scrolls to bottom?

    or is there the other way to do this?

    the other question:

    what event does webbrowser load html completed?? I tried to use webBrowser.Navigated  event but the screen still empty for a while




    Tuesday, September 24, 2013 2:28 AM

Answers

  • ScrollableTextBlock is slow to initialize because it parses the text and builds its structure dynamically. If you are displaying fixed static text, split it up yourself into multiple TextBlocks (each less than 2048 pixels high). This should have good performance. Also, if you have the user click a confirm button at the bottom, then you won't even need to detect scrolling to the bottom.

    <ScrollViewer>
        <StackPanel>
            <TextBlock TextWrapping="Wrap" Text="part 1 ..." />
            <TextBlock TextWrapping="Wrap" Text="part 2 ..." />
            <TextBlock TextWrapping="Wrap" Text="part 3 ..." />
            ...
    <Button Content="I agree to terms" /> </StackPanel> </ScrollViewer>

    Richard Woo
    Tuesday, September 24, 2013 5:45 AM

All replies

  • Hi,

    WebBrowser having scroll by default.And  we can easily able to scroll upto its content.However why you are going for scroll event?

    And for second question you need to put a loader until webbrowser loaded completly. 

    Note:Make sure to use webBrowser.Navigated event . Because it will fire when webbrowser load html completely,



    Tuesday, September 24, 2013 5:12 AM
  • ScrollableTextBlock is slow to initialize because it parses the text and builds its structure dynamically. If you are displaying fixed static text, split it up yourself into multiple TextBlocks (each less than 2048 pixels high). This should have good performance. Also, if you have the user click a confirm button at the bottom, then you won't even need to detect scrolling to the bottom.

    <ScrollViewer>
        <StackPanel>
            <TextBlock TextWrapping="Wrap" Text="part 1 ..." />
            <TextBlock TextWrapping="Wrap" Text="part 2 ..." />
            <TextBlock TextWrapping="Wrap" Text="part 3 ..." />
            ...
    <Button Content="I agree to terms" /> </StackPanel> </ScrollViewer>

    Richard Woo
    Tuesday, September 24, 2013 5:45 AM