in a WPF application I load news from an RSS feed. The contents are displayed in a TextBlock. This TextBlock has a certain size. Contents are cut off by the TextTrimming method. Now I would like at the end of each TextBlock to insert a hyperlink button. The only problem is I do not know exactly what position will be cut on my string. Is there a way to figure this out?
When I insert my Text in my TextBlock and then my Hyperlink-Button, my HyperlinkButton will be cut of. Can I prevent to cutt off my HyperlinkButton?
XAML-Code:
<TextBlock Name="myText" />
C#-Code:
Hyperlink hlink = new Hyperlink(new Run("here"));
myText.Inlines.Clear();
myText.Inlines.Add(value); //description from RSS Feed
myText.Inlines.Add(hlink);