Greg_L_WER
asked on
Windows Phone 7 - Text Block not displaying all the text it is assigned.
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.GetResourceStr eam(new Uri(@"/Tracker;component/H elpFileTex t.txt", UriKind.Relative));
StreamReader streamReader = new StreamReader(resource.Stre am);
StringBuilder sb2 = new StringBuilder();
sb2.Append(streamReader.Re adToEnd()) ;
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
To create the string I am doing the following...
var resource = Application.GetResourceStr
StreamReader streamReader = new StreamReader(resource.Stre
StringBuilder sb2 = new StringBuilder();
sb2.Append(streamReader.Re
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
ASKER
Thanks hb11... unfortunately that link is to my initial question on this issue :( It did solve part of my issue but uncovered another one...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
https://www.experts-exchange.com/questions/26821457/Windows-Phone-7-Text-Block-Content-Size-Restriction.html
can be interesting to read.
Goodluck!