Solved

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

Posted on 2011-02-14
4
1,630 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
Adults who share images on social media aren’t the only ones who need to worry about their privacy. Our culture’s tendency to share every move and celebration affects the privacy of our children, too.
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

690 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