wpf - add newline

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vivien Parlat

    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="{B inding abc}">
    The value of def is:
    <SomeHandler DataContext="{B inding def}">
    <myObject.Items >
    </myObject>

    A TemplateSelecto r 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.
Working...