471,326 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,326 software developers and data experts.

wpf - add newline

Hello,

I'm trying to create the equivalent of a textbox which could format
different kind of "values" using a string.
Currently i can do this: (myObject is an ItemsControl)

<myObject>
<myObject.Items>
The value of abc is:
<SomeHandler DataContext="{Binding abc}">
The value of def is:
<SomeHandler DataContext="{Binding def}">
<myObject.Items>
</myObject>

A TemplateSelector is used to transform each element into a TextBlock,
and a WrapPanel is used to layout the textblocks, so that resizing the
window keeps all textblocks displayed to user, like a the text in a
web browser.

My question is: how can I do to insert NewLines manually ? Web
browsers have an auto wrap feature, but they also include <br /tags.
What's the easiest way to implement this ? And if it is not posible,
any idea i could do this with or without breaking my code ?

Thanks in advance.
Jun 2 '08 #1
0 1268

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Alan Mackenzie | last post: by
5 posts views Thread by Vamsi | last post: by
5 posts views Thread by Kaka | last post: by
29 posts views Thread by runningdog | last post: by
7 posts views Thread by Alex Nordhus | last post: by
4 posts views Thread by Peter Kirk | last post: by
5 posts views Thread by Adam Right | last post: by
1 post views Thread by linq936 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.