I needed to build a control that would display text in a dynamic way similar to the image below:
But the text is data-driven and the control had to render different text, different highlight colors and different highlighted words based on the object it was bound to.
My first reaction for something like this is to build an IValueConverter class, which would set the Inlines property on a TextBlock like this:
<TextBlock TextBlock.Inlines="{Binding Path=MyDataObject, Converter={StaticResource TextFormattingConverter}}"/>
However, the InlineCollection object that is used for the Inlines property has an internal constructor, so we ...