开发者

WPF TextBlock custom wrapping : on the left and after a "."

开发者 https://www.devze.com 2023-01-08 14:49 出处:网络
I\'m trying to display a text that would be wrapped on the left and only after special characters in the string.

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消