windows store apps - TextBlock text doesn't wrap when placed inside a ViewBox -


i have textblock long line of text want wrap. i've placed textblock within viewbox expecting text size change while still wrapping, doesn't seem happen. viewbox resizes textbox text fits on 1 line making text small.

how can use viewbox resize text while still using textwrapping.

here code:

<viewbox>     <textblock text="the option text can dynamically grow/shrink fit more content. more text go here....................." textwrapping="wrap"/> </viewbox> 

this part of windows 8 store application winrt xaml.

just set width on textblock.

        <viewbox width="500">             <textblock width="100" textwrapping="wrap">this text that's long , on 2 lines.</textblock>         </viewbox> 

textblock width 100 in viewbox width 500

so viewbox zoom in/out entire contents. if don't restrict contents either setting width on textblock, viewbox give infinite space expand into. can add root grid width , height within viewbox , lay elements out in that, whole lot zoomed according width of viewbox.

in image, width of textblock 100 zoomed width of viewbox 500. wrapping want, tweak textblock width until looks nice.

(obviously should 3 lines i'm not re-uploading that)


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -