Custom WPF TextBlock packaging: left and after "."

I am trying to display text that will be wrapped on the left, and only after special characters in a string.

I hope the first part can be done in XAML, and I'm sure the second part cannot.

The goal is to wrap the text like this:
- Source: "Object1.Object2.Object3.Property1"
- Wrapped text can be (depending on the width available for the text):
- - ".... Object2.Object3 .Property1 "
- -" .... Object3.Property1 "
- -" .... Property1 "

Do you know that still do it? I tried using the TextBlock "TextWrapping" and "TextTrimming" properties without success.

thank you for your responses

+3
source share
1 answer

You cannot do this with TextWrapping or another WPF property. Instead, you can write converter and send the width of the text block as a binding parameter .

+2
source

Source: https://habr.com/ru/post/1755937/


All Articles