1
votes

I have a textblock inside a vertical stackpanel inside a horizontal stackpanel (think Facebook - the Horz stackpanel has a picture on the left and a vertical stackpanel on the right with a name and a message).

The textblock for the message won't wrap unless I put a width on it (otherwise I guess it doesn't realize that it's at the edge of the page and the text just keeps going off to the right of the page). If I set a static width on the textblock, then the text wraps correctly.

My problem is that I don't want a static width, because I believe different phones will have different widths in pixels, and because I want to later add support for landscape and portrait orientation.

How can I tell my textblock to just fit the page, but not give it a static width, since width=Auto isn't working?

thanks!

1
could you share the xaml part of your code(Including both the stackpanels)?nkchandra
thanks nkchandra, I guess Matt answered the question.Andrew B Schultz

1 Answers

0
votes

Your concern (and need for your question) are unfounded.

Windows Phone 7 devices ALL have the same screen width (480 pixels) and no WP7 devices will be released with a different screen resolution.

If your page supports rotation (landscape & horizontal orientations) then you can use the orientation changed events to adjust between 480 & 800 pixels as appropriate.