I'm using MVVM pattern and I have string type property in my ModelView.
The string may contain following HTML tags:
<b>, </b>, <i>, </i>
I need to make certain parts of text in TextBlock to be in normal, bold or italic.
At moment I have created workaround, a helper method that works like this:
Breaks HTML string into parts
Creates instance of Run class
Depending on tag, sets FontWeight or FontStyle properties
Adds instance of Run class to TextBlock's Inlines collection
This solution works, but it is not compatible with MVVM pattern.
I was thinking of using Convertors, but I'm not sure what property of TextBlock should I do binding to.
What do You think, how can this problem be solved?