WPF and dynamically styled textblock (bold/italic)

13 Views Asked by At

I know that in WPF you can do something like:

<TextBlock.Inlines>
    <Run Text="This is normal text" />
    <Run FontWeight="Bold" Text="This is bolded text" />
</TextBlock.Inlines>

This will allow text with normal weight font and bold font.

What I am trying to accomplish is to have a string that can be bolded in places (some kind of specifier). I have tried a Converter that will check if the text has and around parts of the text and will style appropriately. I have never found a working version of a converter that will properly put a bold or italicized string into a textblock dynamically into xaml.

Please give me some hint on this if possible. Thanks.

I have tried various converters that attempt to do this without result.

0

There are 0 best solutions below