I am using the MVVM pattern and I have a row type property in my ModelView.
A string can contain the following HTML tags:
<b>, </b>, <i>, </i>
I need certain parts of the text in a TextBlock to be normal, bold, or italic.
At the moment, I have created a workaround method, a helper method that works as follows:
Tear an HTML string apart
Creates an instance of the Run class
Depending on the tag, sets the FontWeight or FontStyle properties
Adds an instance of the Run class to the TextBlock Inlines collection.
This solution works, but it is not compatible with the MVVM pattern.
I was thinking about using Convertors, but I'm not sure which TextBlock property should be bound to.
What do you think, how to solve this problem?