Wrap a group of TextBlocks inside StackPanel in Windows Phone -
this code.
<stackpanel orientation="horizontal"> <textblock name="link1" text="this link1"></textblock> <textblock name="text1" text=" text "></textblock> <textblock name="link2" text="this link2"></textblock> <textblock name="text2" text=" other text "></textblock> <textblock name="link3" text="this link3></textblock> </stackpanel>
now stackpanel go out of screen. want wrap contents of go next line on screen end.
i not using <run>
property of textblock defining because want register tap
event textblocks defined links
in above code. using button
s , hyperlink
s not desired here. buttons having same issue of wrapping content.
any or suggestions?
i see 3 options here:
- use
richtextbox
- hoist
wrappanel
windows phone toolkit - write own
panel
i think #1 should preferred approach, assuming can make fit requirements. richtextbox can contain plain text inline hyperlinks
-- latter not expose tap
event, have click
may suffice.
failing that, #2 should straightforward, , may suffice if can work limitation wrappanel treat textblocks atoms (ie, won't wrap intra-textblock text).
approach #3 allow more flexibility in theory, take amount of effort , expertise implement. might face hassles down road when might need adapt custom panel new or unforeseen requirements.
Comments
Post a Comment