Reputation: 21
We are facing problem regarding Text trimming in TextBlock.
We have a Text "My very long label goes here" and we have to show it in following format:
[...g label goes here]
i.e right aligned and text should be trimmed from left (character ellipsis at left side)
We have used FlowDirection of TextBlock, ellipsis is correctly shown on the left side, but text is trimmed from the right side.
FlowDirection = "LeftToRight:"
[My very long lab...]
FlowDirection = "RightToLeft:"
[...My very long lab]
But we need:
[...g label goes here]
Please provide suggestions on this.
Upvotes: 2
Views: 686
Reputation: 8175
You don't mention how the TextBlock gets its string, but if its from a binding, have you considered using a value converter to just trim the string?
I guess this is also only applicable if your requirement is X number of characters before trimming, not if your requirement is Y number of pixels..
Upvotes: 1