Need to show a large amount of text on the screen of Windows Phone 7

I have about 800 KB of text that I want to display on the screen. Can someone tell me about a possible solution to this issue?

From outside the text block 2048X2048, I already tried to split the text into several text blocks, and also tried http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for -wp7.aspx . This, although it works for data up to 40-50 KB, does not scale to 800 KB.

I also tried using Listbox (as mentioned in the first solution in the next post). wp7 - TextBlock with lots of text - huge memory usage - how to avoid it?

This (shown below) also works up to 80-100KB, and after that it takes too much time to load the text.

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <ListBox x:Name="myListBox" Width="468" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <toolkit:WrapPanel /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <TextBlock FontSize="20" Text="{Binding}" TextWrapping="Wrap" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Grid> 
+2
source share
2 answers

In Overflow7, I use the ListBox approach with text - but I agree that sometimes it can take a long time to load.

In Iron7, I use the HTML page displayed in the WebBrowser control.

Another suggestion: if you have a lot of text, you can see how the Kindle displays text - What is the control used in Kindle for Windows Phone 7

+2
source

I know this is an old question, however I wanted to add another solution.

http://blogs.msdn.com/b/stankovski/archive/2013/08/27/yet-another-scrollable-textblock-for-windows-phone.aspx

To accomplish my task, I encapsulated the logic of "splitting" into a separate class that outputs the output as a list of strings. Then you can associate this list with your favorite ListBox and voila control, you have a text block. Separation logic has been optimized for performance, so you get much better processing time and then Alex's ScrollableTextBlock. In addition, since you can bind a list to any ListBox control that supports virtualization, you will have a much more conservative amount of memory.

+1
source

Source: https://habr.com/ru/post/894344/