-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextTrimming - Trim at start #283
Comments
Isn't it supported already? AvaloniaUI/Avalonia#7322 |
Jesus, this looks so "over complicated ". Instead of a single line we have now 8 lines to write... for EVERY single textblock. Also in your example it trims at the middle of text. How to trim at the beginning? I dont even understand how this works. Is there any documentation?! |
I think you can define a resource and then use it:
I think the second argument corresponds to the length of the prefix to keep, so you would set it to Not sure if there are docs for this yet. You can see the docs in this class: You're probably looking for this: So I guess you can do |
@Symbai that was only one possible syntax if you need trimming in middle of the string and want pure XAML. other working solutions:
... We may want to extend docs here, so I transferred this issue. |
That is pretty cool, thank you. I hope the docs will show this example. While its cool that you can do crazy stuff I think many people are only interesting in basic scenarios and prefer short and clean solutions. |
|
Looks like we did not add these new trimming modes to the parse method: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Base/Media/TextTrimming.cs#L49 |
@Gillibald should I create a tracking issue for this? Would there be an option to make parameters work like |
Is your feature request related to a problem? Please describe.
Sometimes its more useful to trim a text at the beginning instead of end.
Describe the solution you'd like
Be able to trim at the beginning. Either by extending the existing
TextTrimming
enum or by adding a new propertyDescribe alternatives you've considered
Using a custom converter
Additional context
The text was updated successfully, but these errors were encountered: