It looks like you want to replace your custom formatting with <Bold> - see TextBlock for more information. Sample from the article:
<TextBlock Name="textBlock1" TextWrapping="Wrap"> <Bold>TextBlock</Bold> is designed to be <Italic>lightweight</Italic>, and is geared specifically at integrating <Italic>small</Italic> portions of flow content into a UI. </TextBlock>
One approach is to reformat the string according to the expected TextBlock .
If you have HTML input, first parse the text with HtmlAgilityPack, and then go through the resulting elements and build a line with b elements replaced with text wrapped with <Bold> and similar to another formatting.
If you know that the database content has only valid start and end pairs (not random HTML), you can even get away with the underlying String.Replace : text = text.Replace ("," ")`.
If you have your own formatting (for example, *boldtext* ), for this you need to create your own parser.
source share