views:

16

answers:

1

I am writing a little diff tool and need to be able to change the color of a character depending on if its the same, added, removed. What would be the best way to handle this? Is a textblock a good control to start with?

+1  A: 

You can use the Run tag.

<TextBlock><Run Foreground="Red">T</Run>ex<Run Foreground="Green">t</Run></TextBlock>
bendewey
How would I tie that into an datatemplate?
Aaron Fischer
@Aaron that depends, I would probably use a converter of some kind and create the Runs in code, but if you provide more details in your question I'll see what I can post for you.
bendewey
@Aaron or just use seperate TextBlocks
bendewey