I have some TextBlock, that can display very long string.
However, when TextBlock content width become greater than TextBlock own width, i want to cut some part of content and place "..." at the end instead.
I will display full content as TooTtip.
<TextBlock Text="{Binding Path=MyValue}" TextAlignment="Right" FontWeight="Bold" ToolTip="{Binding MyValue}" /> As far as i know TextBlock have no events, that can fire after content changed. Is there any good approach to listen something like contentChanged event on TextBlock, calculate text width, compare with control width and cut part of content that not fit?
I need to do it in codebehind, because viewmodel cant be changed some reasons that not matter.
TextTrimmingno eitherCharacterEllipsisorWordEllipsis?