I need to apply some text formatting when displaying items in a WPF ListView. The text formatting is nothing too fancy just setting the background colour differently on certain strings within the text.
The text does not lend itself to different columns so it's not an option to apply a style to one of the ListView columns.
I'm pretty sure the answer is to somehow use Paragraphs or Runs within a TextBlock control in the ListView but I can't find out how to that in the XAML. What I've got so far that demonstrates what I am trying to do but that doesn't work is:
<ListView>
<ListView.View>
<GridView>
<GridViewColumn Width="600">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock>
<Paragraph>
<Binding Path="ListDescription" />
</Paragraph>
</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
The ListDescription prpoperty that is being bound to would be a Paragraph or some other container control that can hold formatted text.