views:

39

answers:

1

Hello everybody,

I'm trying to display a text that would be wrapped on the left and only after special characters in the string.

I Hope the first part could be done in XAML, and I'm pretty sure the second part cannot.

The aim is to wrap a text this way :
- Original text : "Object1.Object2.Object3.Property1"
- Wrapped text could be (depending on the width available for the text):
- - "....Object2.Object3.Property1"
- - "....Object3.Property1"
- - "....Property1"

Do you know anyway to do that? I tried to use the TextBlock "TextWrapping" and "TextTrimming" properties, without success.

Thank you for your answers

+1  A: 

You cannot do that with TextWrapping nor another WPF property. Instead you can write a custom converter and send the width of textblock as a binding parameter.

Victor Marzo
Thank you for this answer, the binding parameters also helped me with another topic :-)I'll try to write the converter, but it's an overhead to use everytime that I don't like so much. I'll see.
Antoine Jeanrichard