Solved

Windows Phone 7 - Text Block not displaying all the text it is assigned.

Posted on 2011-02-14
4
1,618 Views
Last Modified: 2014-11-12
I have a text block inside a scroll viewer.  I am reading a text file into a string and assigning it to the text block.  When I step through the code the complete text document has been properly assigned to the string and the text block displays the 1st "x" characters as it should.  The remaining text isn't visible but you can still scroll the empty text down (as if it was there) until you hit the bottom.  It's like the text block knows the character count but just isn't displaying it all... though it appears to be "using" the appropriate space it would take to display it... seems to be a weird quirk that I'm hoping will be logical to someone :)

To create the string I am doing the following...

var resource = Application.GetResourceStream(new Uri(@"/Tracker;component/HelpFileText.txt", UriKind.Relative));
StreamReader streamReader = new StreamReader(resource.Stream);
StringBuilder sb2 = new StringBuilder();
sb2.Append(streamReader.ReadToEnd());
txblTest.Text = sb2.ToString();

The xaml is very basic... inside te content panel I have a scroll viewer and the text block is inside that.  Scroll view's height is 440 x 591 and the text blocks is Auto(0) for both.

It appears to be displaying about 40% of the text in the document before it "goes black"... is there possibly some restriction to character length max in a textblock?  One thing you can't see on the screen shot is that the vertical "scroll bar indicator" is about 1/2 the way down the screen... you can continue to scroll down through the blank area until you hit the bottom.

Thanks,
Greg

 Screen shot
0
Comment
Question by:Greg_L_WER
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:hb11
ID: 34911735
0
 

Author Comment

by:Greg_L_WER
ID: 34911888
Thanks hb11... unfortunately that link is to my initial question on this issue :(  It did solve part of my issue but uncovered another one...
0
 
LVL 4

Accepted Solution

by:
hb11 earned 250 total points
ID: 34919985
I'm sorry I didn't see that yesterday.

Though you need to have some experience and time  to find out what exactly to do:
http://blogs.msdn.com/b/priozersk/archive/2010/09/08/creating-scrollable-textblock-for-wp7.aspx
may give you the answer you're looking for.

Hope this helps you a little bit more :)
0
 

Author Comment

by:Greg_L_WER
ID: 34954381
Thanks for your help hb11... looks like that will do the trick :)  I knew there had to be some logical reason... finding it is always the trick.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

If you’re having problems with your Nexus 4, you’ll want to take a look at this step-by-step troubleshooting guide that walks you through common issues and helps you solve them so that you can extend the life of your device.  Phone Won't Turn On…
Headphone jack broken? Do you notice the picture quality is better on a different device? If your Samsung Galaxy Note 3 is giving you headaches, this guide will run down a list of things you can do to improve its lifespan.   Phone Will Not Turn O…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now