0

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.

MikeMilw2002
  • 21
  • 1
  • 2
  • You need a Binding Converter that returns a collection of Inlines, and either an attached property or a dependency property in a TextBlock subclass that modifies the TextBlock.Inlines collection, which is not bindable. – Clemens Apr 28 '23 at 15:13

0 Answers0